pleroma/packages/pl-api/lib/entities/application.ts
marcin mikołajczak 036fa32cd3 Add pl-api to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:43:23 +02:00

21 lines
669 B
TypeScript

import { z } from 'zod';
import type { Resolve } from '../utils/types';
/** @see {@link https://docs.joinmastodon.org/entities/Application/} */
const applicationSchema = z.object({
name: z.string().catch(''),
website: z.string().optional().catch(undefined),
client_id: z.string().optional().catch(undefined),
client_secret: z.string().optional().catch(undefined),
redirect_uri: z.string().optional().catch(undefined),
id: z.string().optional().catch(undefined),
/** @deprecated */
vapid_key: z.string().optional().catch(undefined),
});
type Application = Resolve<z.infer<typeof applicationSchema>>;
export { applicationSchema, type Application };