"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validatePayloadAndCreateSdk = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const zod_1 = __importDefault(require("zod"));
const validatePayloadAndCreateSdk = async ({ fieldsSchema, payload, }) => {
    const { settings, fields } = (0, extensions_core_1.validate)({
        schema: zod_1.default.object({
            fields: fieldsSchema,
            settings: zod_1.default.object({}),
            pathway: zod_1.default.object({
                id: zod_1.default.string(),
                definition_id: zod_1.default.string(),
            }),
            activity: zod_1.default.object({ id: zod_1.default.string() }),
            patient: zod_1.default.object({ id: zod_1.default.string() }),
        }),
        payload,
    });
    const { patient, pathway, activity } = payload;
    return {
        fields,
        settings,
        patient,
        pathway,
        activity,
    };
};
exports.validatePayloadAndCreateSdk = validatePayloadAndCreateSdk;
//# sourceMappingURL=validatePayloadAndCreateSdk.js.map