"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseStringToPhoneNumber = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const config_1 = require("./config");
const zod_1 = require("zod");
exports.parseStringToPhoneNumber = {
    key: 'parseStringToPhoneNumber',
    title: 'Parse text to phone number',
    description: 'Transform or parse text to a phone number.',
    category: extensions_core_1.Category.DATA,
    fields: config_1.fields,
    dataPoints: config_1.dataPoints,
    previewable: true,
    onActivityCreated: async (payload, onComplete) => {
        const { fields: { text }, } = (0, extensions_core_1.validate)({
            schema: zod_1.z.object({
                fields: config_1.FieldsValidationSchema,
            }),
            payload,
        });
        await onComplete({
            data_points: {
                phoneNumber: String(text),
            },
        });
    },
};
//# sourceMappingURL=parseStringToPhoneNumber.js.map