"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.executeBot = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const config_1 = require("./config");
const utils_1 = require("../../utils");
exports.executeBot = {
    key: 'executeBot',
    category: extensions_core_1.Category.EHR_INTEGRATIONS,
    title: 'Execute Bot',
    description: 'Execute a Medplum Bot',
    fields: config_1.fields,
    previewable: false,
    dataPoints: config_1.dataPoints,
    onActivityCreated: async (payload, onComplete, onError) => {
        const { fields: input, medplumSdk } = await (0, utils_1.validateAndCreateSdkClient)({
            fieldsSchema: config_1.FieldsValidationSchema,
            payload,
        });
        const res = await medplumSdk.executeBot(input.botId, input.body, 'application/json');
        await onComplete({
            data_points: {
                data: JSON.stringify(res),
            },
        });
    },
};
//# sourceMappingURL=executeBot.js.map