UNPKG

@nestbox-ai/cli

Version:

The cli tools that helps developers to build agents

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