/**
 * Facebook PSID 登录响应
 */
import { z } from "zod";

import {
  booleanOrFalse,
  schemaOrNull,
  stringOrEmpty,
} from "../../nullable-defaults";
import { UserSchema } from "../../user/user";

export const FacebookPsidLoginResponseSchema = z.object({
  token: z.string(),
  refreshToken: stringOrEmpty,
  matchedBy: stringOrEmpty,
  fbAsid: stringOrEmpty,
  fbPsid: stringOrEmpty,
  hasCompleteFacebookIdentity: booleanOrFalse,
  isGuest: booleanOrFalse,
  user: schemaOrNull(UserSchema),
  userId: stringOrEmpty,
});

export type FacebookPsidLoginResponseInput = z.input<
  typeof FacebookPsidLoginResponseSchema
>;
export type FacebookPsidLoginResponseData = z.output<
  typeof FacebookPsidLoginResponseSchema
>;
