"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listToCommaSeparatedText = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const config_1 = require("./config");
const zod_1 = require("zod");
exports.listToCommaSeparatedText = {
    key: 'listToCommaSeparatedText',
    title: 'List to comma separated text',
    description: 'Transform or parse list (string array) to a comma separated text.',
    category: extensions_core_1.Category.DATA,
    fields: config_1.fields,
    dataPoints: config_1.dataPoints,
    previewable: false,
    onActivityCreated: async (payload, onComplete) => {
        const { fields: { list }, } = (0, extensions_core_1.validate)({
            schema: zod_1.z.object({
                fields: config_1.FieldsValidationSchema,
            }),
            payload,
        });
        const output = list.join(',');
        await onComplete({
            data_points: {
                listText: output,
            },
        });
    },
};
//# sourceMappingURL=listToCommaSeparatedText.js.map