Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

690 B
Raw Blame
import { HttpMethod, httpClient, QueryParams } from '@activepieces/pieces-common';

import type { RobollyAuthValue } from './types';

function baseUrl(): string {
	return 'https://api.robolly.com';
}

async function request<T>({ auth, method, path, query, body }: RequestParams): Promise<T> {
	const response = await httpClient.sendRequest<T>({
		method,
		url: `${baseUrl()}${path}`,
		headers: {
			Authorization: `Bearer ${auth.secret_text}`,
		},
		queryParams: query,
		body,
	});
	return response.body;
}

export const robollyClient = { baseUrl, request };

type RequestParams = {
	auth: RobollyAuthValue;
	method: HttpMethod;
	path: string;
	query?: QueryParams;
	body?: unknown;
};