UNPKG

@nestbox-ai/cli

Version:

The cli tools that helps developers to build agents

21 lines (20 loc) 731 B
import { Configuration } from "@nestbox-ai/admin"; export interface AuthResult { authToken: { token: string; serverUrl: string; accessToken?: string; }; configuration: Configuration; } /** * Common authentication and configuration setup * Returns authentication token and configured API client * Exits the process if authentication fails */ export declare function setupAuthAndConfig(): AuthResult | null; /** * Wrapper function that ensures authentication is set up before executing a callback * Automatically handles authentication errors and provides configured API instances */ export declare function withAuth<T>(callback: (authResult: AuthResult) => Promise<T>): Promise<T | void>;