"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const zod_1 = require("zod");
const field_1 = require("../../../../types/field");
const filter_1 = require("../../../../types/filter");
const fieldId_1 = require("../fieldId");
const commonStringFilterRuleSchema = zod_1.z.object({
    fieldId: (0, fieldId_1.getFieldIdSchema)({ additionalDescription: null }),
    fieldType: zod_1.z.union([
        zod_1.z.literal(field_1.DimensionType.STRING),
        zod_1.z.literal(field_1.MetricType.STRING),
    ]),
    fieldFilterType: zod_1.z.literal(filter_1.FilterType.STRING),
});
const stringFilterSchema = zod_1.z.union([
    commonStringFilterRuleSchema.extend({
        operator: zod_1.z.union([
            zod_1.z.literal(filter_1.FilterOperator.NULL),
            zod_1.z.literal(filter_1.FilterOperator.NOT_NULL),
        ]),
    }),
    commonStringFilterRuleSchema.extend({
        operator: zod_1.z.union([
            zod_1.z.literal(filter_1.FilterOperator.EQUALS),
            zod_1.z.literal(filter_1.FilterOperator.NOT_EQUALS),
            zod_1.z.literal(filter_1.FilterOperator.STARTS_WITH),
            zod_1.z.literal(filter_1.FilterOperator.ENDS_WITH),
            zod_1.z.literal(filter_1.FilterOperator.INCLUDE),
            zod_1.z.literal(filter_1.FilterOperator.NOT_INCLUDE),
        ]),
        values: zod_1.z.array(zod_1.z.string()),
    }),
]);
exports.default = stringFilterSchema;
//# sourceMappingURL=stringFilters.js.map