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