Files
ncd-fe/packages/pl-api/lib/entities/user-info.ts
nicole mikołajczyk 53049fe757 pl-api: some mastodon updates
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2025-09-19 21:15:04 +02:00

22 lines
456 B
TypeScript

import * as v from 'valibot';
/**
* @category Schemas
* @see {@link https://docs.joinmastodon.org/methods/oauth/#response-3}
*/
const userInfoSchema = v.object({
iss: v.string(),
sub: v.string(),
name: v.string(),
preferred_username: v.string(),
profile: v.string(),
picture: v.fallback(v.string(), ''),
});
/**
* @category Entity types
*/
type UserInfo = v.InferOutput<typeof userInfoSchema>;
export { userInfoSchema, type UserInfo };