@mesh-tech/mesh-cli
Version:
CLI for Mesh platform development utilities
27 lines (26 loc) • 965 B
TypeScript
export interface AgentApiTarget {
apiBaseUrl: string;
loginContext?: string;
conversationPathPrefix?: string;
hubBaseUrl?: string;
token?: string;
}
export declare class TargetResolutionError extends Error {
}
export declare function resolveTarget(opts: {
target?: string;
apiUrl?: string;
context?: string;
}): AgentApiTarget;
export declare function agentApiFetch(target: AgentApiTarget, apiPath: string): Promise<Response>;
export interface AgentApiSendInit {
method: "POST" | "PUT" | "PATCH" | "DELETE";
json?: unknown;
body?: Uint8Array | string;
contentType?: string;
}
export declare function agentApiSend(target: AgentApiTarget, apiPath: string, init: AgentApiSendInit): Promise<Response>;
export declare function describeNetworkError(err: unknown, target: AgentApiTarget): string;
export declare function describeHttpError(res: Response, target: AgentApiTarget, ctx?: {
id?: string;
}): Promise<string>;