"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toolEditContentOutputSchema = exports.toolEditContentArgsSchema = exports.TOOL_EDIT_CONTENT_DESCRIPTION = void 0;
const zod_1 = require("zod");
exports.TOOL_EDIT_CONTENT_DESCRIPTION = 'Edit a dashboard or chart by applying a patch to its JSON, then validate before persisting';
exports.toolEditContentArgsSchema = zod_1.z.object({
    slug: zod_1.z.string().min(1).describe('Slug of the dashboard or chart to edit'),
    type: zod_1.z
        .enum(['dashboard', 'chart'])
        .describe('Type of Lightdash content to edit'),
    patch: zod_1.z
        .array(zod_1.z.unknown())
        .describe('RFC6902 Patch objects array to apply to the current dashboard or chart JSON'),
});
const toolEditContentMetadataSchema = zod_1.z.discriminatedUnion('status', [
    zod_1.z.object({ status: zod_1.z.literal('error') }),
    zod_1.z.object({
        status: zod_1.z.literal('success'),
        slug: zod_1.z.string(),
        name: zod_1.z.string(),
        uuid: zod_1.z.string(),
        href: zod_1.z.string(),
        warnings: zod_1.z.array(zod_1.z.string()),
        versionUuids: zod_1.z.object({
            before: zod_1.z.string().nullable(),
            after: zod_1.z.string().nullable(),
        }),
    }),
]);
exports.toolEditContentOutputSchema = zod_1.z.object({
    result: zod_1.z.string(),
    metadata: toolEditContentMetadataSchema,
});
//# sourceMappingURL=toolEditContentArgs.js.map