"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TasksApiClient = void 0;
const axios_1 = __importDefault(require("axios"));
const lodash_1 = require("lodash");
class TasksApiClient {
    constructor({ baseUrl, apiKey }) {
        this.client = axios_1.default.create({
            baseURL: baseUrl,
            headers: {
                Authorization: apiKey,
                'Content-Type': 'application/json',
            },
        });
    }
    async getCareflowComments(input) {
        const queryParams = new URLSearchParams();
        queryParams.set('careflow_id', input.careflowId);
        if ((input === null || input === void 0 ? void 0 : input.limit) !== undefined) {
            queryParams.set('limit', input.limit.toString());
        }
        if ((input === null || input === void 0 ? void 0 : input.offset) !== undefined) {
            queryParams.set('offset', input.offset.toString());
        }
        const response = await this.client.get(`/comments?${queryParams.toString()}`);
        return response;
    }
    async getTasks(input) {
        const queryParams = new URLSearchParams();
        Object.entries(input).forEach(([key, value]) => {
            if (!(0, lodash_1.isNil)(value)) {
                queryParams.set(key, value.toString());
            }
        });
        const response = await this.client.get(`/tasks?${queryParams.toString()}`);
        return response;
    }
}
exports.TasksApiClient = TasksApiClient;
//# sourceMappingURL=client.js.map