@crosspost/types 0.1.9 → 0.1.10
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 +7 -4
- package/dist/index.d.cts +38 -17
- package/dist/index.d.ts +38 -17
- package/dist/index.js +7 -4
- package/package.json +1 -1
- package/src/auth.ts +6 -3
package/dist/index.cjs
CHANGED
@@ -224,7 +224,10 @@ var AuthInitRequestSchema = import_zod4.z.object({
|
|
224
224
|
successUrl: import_zod4.z.string().url().optional().describe(
|
225
225
|
"URL to redirect to on successful authentication"
|
226
226
|
),
|
227
|
-
errorUrl: import_zod4.z.string().url().optional().describe("URL to redirect to on authentication error")
|
227
|
+
errorUrl: import_zod4.z.string().url().optional().describe("URL to redirect to on authentication error"),
|
228
|
+
redirect: import_zod4.z.boolean().optional().default(false).describe(
|
229
|
+
"Whether to redirect to successUrl/errorUrl (true) or return data directly (false)"
|
230
|
+
)
|
228
231
|
}).describe("Auth initialization request");
|
229
232
|
var AuthUrlResponseSchema = import_zod4.z.object({
|
230
233
|
url: import_zod4.z.string().describe("Authentication URL to redirect the user to"),
|
@@ -272,9 +275,9 @@ var ConnectedAccountSchema = import_zod4.z.object({
|
|
272
275
|
profileUrl: import_zod4.z.string().optional().describe("URL to the user profile"),
|
273
276
|
connectedAt: import_zod4.z.string().optional().describe("When the account was connected")
|
274
277
|
}).describe("Connected account");
|
275
|
-
var ConnectedAccountsResponseSchema = import_zod4.z.
|
276
|
-
|
277
|
-
);
|
278
|
+
var ConnectedAccountsResponseSchema = import_zod4.z.object({
|
279
|
+
accounts: import_zod4.z.array(ConnectedAccountSchema)
|
280
|
+
}).describe("Response containing an array of connected accounts");
|
278
281
|
var NearAuthorizationRequestSchema = import_zod4.z.object({
|
279
282
|
// No additional parameters needed, as the NEAR account ID is extracted from the signature
|
280
283
|
}).describe("NEAR authorization request");
|
package/dist/index.d.cts
CHANGED
@@ -299,12 +299,15 @@ declare const PlatformParamSchema: z.ZodObject<{
|
|
299
299
|
declare const AuthInitRequestSchema: z.ZodObject<{
|
300
300
|
successUrl: z.ZodOptional<z.ZodString>;
|
301
301
|
errorUrl: z.ZodOptional<z.ZodString>;
|
302
|
+
redirect: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
302
303
|
}, "strip", z.ZodTypeAny, {
|
304
|
+
redirect: boolean;
|
303
305
|
successUrl?: string | undefined;
|
304
306
|
errorUrl?: string | undefined;
|
305
307
|
}, {
|
306
308
|
successUrl?: string | undefined;
|
307
309
|
errorUrl?: string | undefined;
|
310
|
+
redirect?: boolean | undefined;
|
308
311
|
}>;
|
309
312
|
declare const AuthUrlResponseSchema: z.ZodObject<{
|
310
313
|
url: z.ZodString;
|
@@ -434,25 +437,43 @@ declare const ConnectedAccountSchema: z.ZodObject<{
|
|
434
437
|
profileUrl?: string | undefined;
|
435
438
|
connectedAt?: string | undefined;
|
436
439
|
}>;
|
437
|
-
declare const ConnectedAccountsResponseSchema: z.
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
440
|
+
declare const ConnectedAccountsResponseSchema: z.ZodObject<{
|
441
|
+
accounts: z.ZodArray<z.ZodObject<{
|
442
|
+
platform: z.ZodNativeEnum<typeof Platform>;
|
443
|
+
userId: z.ZodString;
|
444
|
+
username: z.ZodOptional<z.ZodString>;
|
445
|
+
profileUrl: z.ZodOptional<z.ZodString>;
|
446
|
+
connectedAt: z.ZodOptional<z.ZodString>;
|
447
|
+
}, "strip", z.ZodTypeAny, {
|
448
|
+
platform: Platform;
|
449
|
+
userId: string;
|
450
|
+
username?: string | undefined;
|
451
|
+
profileUrl?: string | undefined;
|
452
|
+
connectedAt?: string | undefined;
|
453
|
+
}, {
|
454
|
+
platform: Platform;
|
455
|
+
userId: string;
|
456
|
+
username?: string | undefined;
|
457
|
+
profileUrl?: string | undefined;
|
458
|
+
connectedAt?: string | undefined;
|
459
|
+
}>, "many">;
|
443
460
|
}, "strip", z.ZodTypeAny, {
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
461
|
+
accounts: {
|
462
|
+
platform: Platform;
|
463
|
+
userId: string;
|
464
|
+
username?: string | undefined;
|
465
|
+
profileUrl?: string | undefined;
|
466
|
+
connectedAt?: string | undefined;
|
467
|
+
}[];
|
449
468
|
}, {
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
469
|
+
accounts: {
|
470
|
+
platform: Platform;
|
471
|
+
userId: string;
|
472
|
+
username?: string | undefined;
|
473
|
+
profileUrl?: string | undefined;
|
474
|
+
connectedAt?: string | undefined;
|
475
|
+
}[];
|
476
|
+
}>;
|
456
477
|
declare const NearAuthorizationRequestSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
457
478
|
declare const NearAuthorizationResponseSchema: z.ZodObject<{
|
458
479
|
nearAccount: z.ZodString;
|
package/dist/index.d.ts
CHANGED
@@ -299,12 +299,15 @@ declare const PlatformParamSchema: z.ZodObject<{
|
|
299
299
|
declare const AuthInitRequestSchema: z.ZodObject<{
|
300
300
|
successUrl: z.ZodOptional<z.ZodString>;
|
301
301
|
errorUrl: z.ZodOptional<z.ZodString>;
|
302
|
+
redirect: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
302
303
|
}, "strip", z.ZodTypeAny, {
|
304
|
+
redirect: boolean;
|
303
305
|
successUrl?: string | undefined;
|
304
306
|
errorUrl?: string | undefined;
|
305
307
|
}, {
|
306
308
|
successUrl?: string | undefined;
|
307
309
|
errorUrl?: string | undefined;
|
310
|
+
redirect?: boolean | undefined;
|
308
311
|
}>;
|
309
312
|
declare const AuthUrlResponseSchema: z.ZodObject<{
|
310
313
|
url: z.ZodString;
|
@@ -434,25 +437,43 @@ declare const ConnectedAccountSchema: z.ZodObject<{
|
|
434
437
|
profileUrl?: string | undefined;
|
435
438
|
connectedAt?: string | undefined;
|
436
439
|
}>;
|
437
|
-
declare const ConnectedAccountsResponseSchema: z.
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
440
|
+
declare const ConnectedAccountsResponseSchema: z.ZodObject<{
|
441
|
+
accounts: z.ZodArray<z.ZodObject<{
|
442
|
+
platform: z.ZodNativeEnum<typeof Platform>;
|
443
|
+
userId: z.ZodString;
|
444
|
+
username: z.ZodOptional<z.ZodString>;
|
445
|
+
profileUrl: z.ZodOptional<z.ZodString>;
|
446
|
+
connectedAt: z.ZodOptional<z.ZodString>;
|
447
|
+
}, "strip", z.ZodTypeAny, {
|
448
|
+
platform: Platform;
|
449
|
+
userId: string;
|
450
|
+
username?: string | undefined;
|
451
|
+
profileUrl?: string | undefined;
|
452
|
+
connectedAt?: string | undefined;
|
453
|
+
}, {
|
454
|
+
platform: Platform;
|
455
|
+
userId: string;
|
456
|
+
username?: string | undefined;
|
457
|
+
profileUrl?: string | undefined;
|
458
|
+
connectedAt?: string | undefined;
|
459
|
+
}>, "many">;
|
443
460
|
}, "strip", z.ZodTypeAny, {
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
461
|
+
accounts: {
|
462
|
+
platform: Platform;
|
463
|
+
userId: string;
|
464
|
+
username?: string | undefined;
|
465
|
+
profileUrl?: string | undefined;
|
466
|
+
connectedAt?: string | undefined;
|
467
|
+
}[];
|
449
468
|
}, {
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
469
|
+
accounts: {
|
470
|
+
platform: Platform;
|
471
|
+
userId: string;
|
472
|
+
username?: string | undefined;
|
473
|
+
profileUrl?: string | undefined;
|
474
|
+
connectedAt?: string | undefined;
|
475
|
+
}[];
|
476
|
+
}>;
|
456
477
|
declare const NearAuthorizationRequestSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
457
478
|
declare const NearAuthorizationResponseSchema: z.ZodObject<{
|
458
479
|
nearAccount: z.ZodString;
|
package/dist/index.js
CHANGED
@@ -124,7 +124,10 @@ var AuthInitRequestSchema = z4.object({
|
|
124
124
|
successUrl: z4.string().url().optional().describe(
|
125
125
|
"URL to redirect to on successful authentication"
|
126
126
|
),
|
127
|
-
errorUrl: z4.string().url().optional().describe("URL to redirect to on authentication error")
|
127
|
+
errorUrl: z4.string().url().optional().describe("URL to redirect to on authentication error"),
|
128
|
+
redirect: z4.boolean().optional().default(false).describe(
|
129
|
+
"Whether to redirect to successUrl/errorUrl (true) or return data directly (false)"
|
130
|
+
)
|
128
131
|
}).describe("Auth initialization request");
|
129
132
|
var AuthUrlResponseSchema = z4.object({
|
130
133
|
url: z4.string().describe("Authentication URL to redirect the user to"),
|
@@ -172,9 +175,9 @@ var ConnectedAccountSchema = z4.object({
|
|
172
175
|
profileUrl: z4.string().optional().describe("URL to the user profile"),
|
173
176
|
connectedAt: z4.string().optional().describe("When the account was connected")
|
174
177
|
}).describe("Connected account");
|
175
|
-
var ConnectedAccountsResponseSchema = z4.
|
176
|
-
|
177
|
-
);
|
178
|
+
var ConnectedAccountsResponseSchema = z4.object({
|
179
|
+
accounts: z4.array(ConnectedAccountSchema)
|
180
|
+
}).describe("Response containing an array of connected accounts");
|
178
181
|
var NearAuthorizationRequestSchema = z4.object({
|
179
182
|
// No additional parameters needed, as the NEAR account ID is extracted from the signature
|
180
183
|
}).describe("NEAR authorization request");
|
package/package.json
CHANGED
package/src/auth.ts
CHANGED
@@ -10,6 +10,9 @@ export const AuthInitRequestSchema = z.object({
|
|
10
10
|
'URL to redirect to on successful authentication',
|
11
11
|
),
|
12
12
|
errorUrl: z.string().url().optional().describe('URL to redirect to on authentication error'),
|
13
|
+
redirect: z.boolean().optional().default(false).describe(
|
14
|
+
'Whether to redirect to successUrl/errorUrl (true) or return data directly (false)',
|
15
|
+
),
|
13
16
|
}).describe('Auth initialization request');
|
14
17
|
|
15
18
|
export const AuthUrlResponseSchema = z.object({
|
@@ -67,9 +70,9 @@ export const ConnectedAccountSchema = z.object({
|
|
67
70
|
connectedAt: z.string().optional().describe('When the account was connected'),
|
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
|