import define from "../../define.js";
import { ReversiGames } from "../../../../models/index.js";
import { checkCrc } from "../../../../services/reversi/index.js";
export const meta = {
    tags: [
        "reversi"
    ],
    requireCredential: false,
    res: {
        type: "object",
        optional: true,
        nullable: false
    }
};
export const paramDef = {
    type: "object",
    properties: {
        gameId: {
            type: "string",
            format: "misskey:id"
        },
        crc32: {
            anyOf: [
                {
                    type: "string"
                },
                {
                    type: "number"
                }
            ]
        }
    },
    required: [
        "gameId",
        "crc32"
    ]
};
export default define(meta, paramDef, async (ps)=>{
    const game = await checkCrc(ps.gameId, ps.crc32);
    return game ? await ReversiGames.packDetail(game) : undefined;
});
