"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentCareflowId = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const config_1 = require("./config");
const zod_1 = require("zod");
exports.getCurrentCareflowId = {
    key: 'getCurrentCareflowId',
    category: extensions_core_1.Category.WORKFLOW,
    title: 'Get current care flow ID',
    description: 'Get the current care flow ID',
    fields: config_1.fields,
    dataPoints: config_1.dataPoints,
    previewable: false,
    supports_automated_retries: true,
    onEvent: async ({ payload, onComplete, helpers }) => {
        const { pathway: { id: currentCareflowId, definition_id: currentCareflowDefinitionId }, } = (0, extensions_core_1.validate)({
            schema: zod_1.z.object({
                pathway: config_1.PathwayValidationSchema,
            }),
            payload,
        });
        await onComplete({
            data_points: {
                careFlowId: currentCareflowId,
                careFlowDefinitionId: currentCareflowDefinitionId,
            },
        });
    },
};
//# sourceMappingURL=getCurrentCareflowId.js.map