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