"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateActionFields = exports.FieldsValidationSchema = exports.fields = void 0;
const zod_1 = require("zod");
const extensions_core_1 = require("@awell-health/extensions-core");
const awell_1 = require("../../../../../../src/lib/awell");
exports.fields = {
    to: {
        id: 'to',
        label: 'To',
        description: 'The email address of the recipient.',
        type: extensions_core_1.FieldType.STRING,
        /**
         * I am purposely not using the `email` stringType yet.
         * More information here: https://awellhealth.atlassian.net/jira/polaris/projects/AH/ideas/view/548618?selectedIssue=AH-176&issueViewLayout=sidebar&issueViewSection=capture&focusedInsightId=3144292
         */
        // stringType: StringType.EMAIL,
        required: true,
    },
    subject: {
        id: 'subject',
        label: 'Subject',
        description: 'The subject of your email.',
        type: extensions_core_1.FieldType.STRING,
        required: true,
    },
    body: {
        id: 'body',
        label: 'Body',
        description: 'The content of your message.',
        type: extensions_core_1.FieldType.HTML,
        required: true,
    },
};
exports.FieldsValidationSchema = zod_1.z.object({
    to: awell_1.CommaSeparatedEmailsValidationSchema.refine((emails) => emails.length > 0, {
        message: 'At least one email address is required',
    }),
    subject: zod_1.z.string(),
    body: zod_1.z.string(),
});
const validateActionFields = (fields) => {
    const parsedData = exports.FieldsValidationSchema.parse(fields);
    return parsedData;
};
exports.validateActionFields = validateActionFields;
//# sourceMappingURL=fields.js.map