"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationDefinition = exports.ApplicationSet = exports.Application = exports.ApplicationSpec = exports.ApplicationSource = exports.KubernetesResource = void 0;
const zod_1 = require("zod");
exports.KubernetesResource = zod_1.z.object({
    apiVersion: zod_1.z.string(),
});
exports.ApplicationSource = zod_1.z.object({
    chart: zod_1.z.string().optional(),
    repoURL: zod_1.z.string(),
    targetRevision: zod_1.z.string(),
});
exports.ApplicationSpec = zod_1.z.object({
    source: exports.ApplicationSource.optional(),
    sources: zod_1.z.array(exports.ApplicationSource).optional(),
});
exports.Application = exports.KubernetesResource.extend({
    kind: zod_1.z.literal('Application'),
    spec: exports.ApplicationSpec,
});
exports.ApplicationSet = exports.KubernetesResource.extend({
    kind: zod_1.z.literal('ApplicationSet'),
    spec: zod_1.z.object({
        template: zod_1.z.object({
            spec: exports.ApplicationSpec,
        }),
    }),
});
exports.ApplicationDefinition = exports.Application.or(exports.ApplicationSet);
//# sourceMappingURL=schema.js.map