"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 recipient (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 to send the message from (E.164 format).',
        type: extensions_core_1.FieldType.STRING,
        stringType: extensions_core_1.StringType.PHONE,
        required: true,
    },
    agentMessage: {
        id: 'agentMessage',
        label: 'Agent message',
        description: 'The message to send. When omitted and a pathway is configured on the agent number, the pathway generates the message.',
        type: extensions_core_1.FieldType.TEXT,
        required: false,
    },
    pathwayId: {
        id: 'pathwayId',
        label: 'Pathway ID',
        description: 'The conversational pathway to drive the SMS conversation with.',
        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,
        },
    },
    webhook: {
        id: 'webhook',
        label: 'Webhook',
        description: 'The webhook URL to send SMS conversation events to. The Awell activity ID is appended as an activity_id query parameter for correlation.',
        type: extensions_core_1.FieldType.STRING,
        stringType: extensions_core_1.StringType.URL,
        required: false,
    },
    timeOut: {
        id: 'timeOut',
        label: 'Timeout (seconds)',
        description: 'Seconds of user silence (after an agent message) before the timeout flow fires (warning message and/or conversation end). Overrides the time_out on the agent number\u2019s SMS config and persists on the conversation.',
        type: extensions_core_1.FieldType.NUMERIC,
        required: false,
    },
    timeoutMessage: {
        id: 'timeoutMessage',
        label: 'Timeout message',
        description: 'The message sent to the user when the timeout fires. Overrides the timeout_message on the agent number\u2019s SMS config.',
        type: extensions_core_1.FieldType.TEXT,
        required: false,
    },
    warningTime: {
        id: 'warningTime',
        label: 'Warning time (seconds)',
        description: 'Seconds of user silence before sending the warning message. Must be less than the timeout. Overrides the warning_time on the agent number\u2019s SMS config.',
        type: extensions_core_1.FieldType.NUMERIC,
        required: false,
    },
    warningMessage: {
        id: 'warningMessage',
        label: 'Warning message',
        description: 'The warning message sent to the user at the warning time. Overrides the warning_message on the agent number\u2019s SMS config.',
        type: extensions_core_1.FieldType.TEXT,
        required: false,
    },
    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,
    },
    metadata: {
        id: 'metadata',
        label: 'Metadata',
        description: 'Add any additional information you want to associate with the conversation.',
        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),
    agentMessage: zod_1.default.string().optional(),
    pathwayId: zod_1.default.string().optional(),
    newConversation: sharedActionFields_1.dropdownOptionsBooleanSchema.optional(),
    webhook: zod_1.default.string().optional(),
    timeOut: zod_1.default.number().optional(),
    timeoutMessage: zod_1.default.string().optional(),
    warningTime: zod_1.default.number().optional(),
    warningMessage: zod_1.default.string().optional(),
    requestData: sharedActionFields_1.JsonObjectSchema.optional(),
    metadata: sharedActionFields_1.JsonObjectSchema.optional(),
});
//# sourceMappingURL=fields.js.map