"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GithubIssue = void 0;
const zod_1 = require("zod");
const GithubIssueBase = zod_1.z.object({
    number: zod_1.z.number(),
    state: zod_1.z.string().transform((val) => val.toLowerCase()),
    title: zod_1.z.string(),
    body: zod_1.z.string(),
});
const GithubGraphqlIssue = GithubIssueBase.extend({
    updatedAt: zod_1.z.string(),
}).transform((issue) => {
    const lastModified = issue.updatedAt;
    const { number, state, title, body } = issue;
    return { number, state, title, body, lastModified };
});
const GithubRestIssue = GithubIssueBase.extend({
    updated_at: zod_1.z.string(),
}).transform((issue) => {
    const lastModified = issue.updated_at;
    const { number, state, title, body } = issue;
    return { number, state, title, body, lastModified };
});
exports.GithubIssue = zod_1.z.union([GithubGraphqlIssue, GithubRestIssue]);
//# sourceMappingURL=issue.js.map