UNPKG

@nestbox-ai/cli

Version:

The cli tools that helps developers to build agents

23 lines (19 loc) 646 B
import { MiscellaneousApi, ProjectsApi } from "@nestbox-ai/admin"; import { setupAuthAndConfig } from "../../utils/api"; export interface ApiInstances { miscellaneousApi: MiscellaneousApi; projectsApi: ProjectsApi; } /** * Create API instances with current authentication using setupAuthAndConfig */ export function createApis(): ApiInstances { const authResult = setupAuthAndConfig(); if (!authResult) { throw new Error('No authentication token found. Please log in first.'); } return { miscellaneousApi: new MiscellaneousApi(authResult.configuration), projectsApi: new ProjectsApi(authResult.configuration), }; }