"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldsValidationSchema = exports.fields = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const zod_1 = __importDefault(require("zod"));
const sharedActionFields_1 = require("../../../lib/sharedActionFields");
exports.fields = {
    userNumber: {
        id: 'userNumber',
        label: 'User phone number',
        description: 'The phone number of the user in the conversation (E.164 format).',
        type: extensions_core_1.FieldType.STRING,
        stringType: extensions_core_1.StringType.PHONE,
        required: true,
    },
    agentNumber: {
        id: 'agentNumber',
        label: 'Agent phone number',
        description: 'The Bland-owned, SMS-enabled phone number for the conversation (E.164 format).',
        type: extensions_core_1.FieldType.STRING,
        stringType: extensions_core_1.StringType.PHONE,
        required: true,
    },
    message: {
        id: 'message',
        label: 'Message',
        description: 'The message to seed the conversation with. It is recorded in the conversation but NOT sent to the user.',
        type: extensions_core_1.FieldType.TEXT,
        required: true,
    },
    sender: {
        id: 'sender',
        label: 'Sender',
        description: 'Who the seeded message is attributed to. Defaults to USER when omitted.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
        options: {
            dropdownOptions: [
                { value: 'USER', label: 'User' },
                { value: 'AGENT', label: 'Agent' },
            ],
        },
    },
    currPathwayId: {
        id: 'currPathwayId',
        label: 'Current pathway ID',
        description: 'The pathway to position the conversation on.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
    currPathwayVersion: {
        id: 'currPathwayVersion',
        label: 'Current pathway version',
        description: 'The version of the pathway.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
    currentNodeId: {
        id: 'currentNodeId',
        label: 'Current node ID',
        description: 'The pathway node the conversation should be positioned at.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
    newConversation: {
        id: 'newConversation',
        label: 'Start new conversation',
        description: 'When enabled, starts a fresh conversation instead of continuing an existing one.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
        options: {
            dropdownOptions: sharedActionFields_1.dropdownOptionsBoolean,
        },
    },
    requestData: {
        id: 'requestData',
        label: 'Request data',
        description: 'JSON object of variables made available to the pathway/agent during the conversation. Can be referenced with Prompt Variables.',
        type: extensions_core_1.FieldType.JSON,
        required: false,
    },
};
exports.FieldsValidationSchema = zod_1.default.object({
    userNumber: zod_1.default.string().trim().min(1),
    agentNumber: zod_1.default.string().trim().min(1),
    message: zod_1.default.string().trim().min(1),
    sender: zod_1.default.enum(['USER', 'AGENT']).optional(),
    currPathwayId: zod_1.default.string().optional(),
    currPathwayVersion: zod_1.default.string().optional(),
    currentNodeId: zod_1.default.string().optional(),
    newConversation: sharedActionFields_1.dropdownOptionsBooleanSchema.optional(),
    requestData: sharedActionFields_1.JsonObjectSchema.optional(),
});
//# sourceMappingURL=fields.js.map