///
///
import { createLogger, Logger } from 'winston';
import { AxiosError } from 'axios';
export interface DBOSCloudCredentials {
token: string;
refreshToken?: string;
userName: string;
organization: string;
}
export interface UserProfile {
Name: string;
Email: string;
Organization: string;
SubscriptionPlan: string;
}
export declare enum AppLanguages {
Node = "node",
Python = "python",
Go = "go",
Java = "java"
}
export declare const defaultConfigFilePath = "dbos-config.yaml";
export declare const DBOSCloudHost: string;
export declare const dbosEnvPath = ".dbos";
export declare function retrieveApplicationName(logger: Logger, silent?: boolean, configFilePath?: string): string | undefined;
export declare function retrieveApplicationLanguage(configFilePath?: string): string;
export type CLILogger = ReturnType;
export declare function getLogger(verbose?: boolean): CLILogger;
export declare function isTokenExpired(token: string): boolean;
export declare function credentialsExist(): boolean;
export declare function deleteCredentials(): void;
export declare function writeCredentials(credentials: DBOSCloudCredentials): void;
export declare function checkReadFile(path: string, encoding?: BufferEncoding): string | Buffer;
export declare const sleepms: (ms: number) => Promise;
export declare function createDirectory(path: string): string | undefined;
export interface CloudAPIErrorResponse {
message: string;
statusCode: number;
requestID: string;
DetailedError?: string;
}
export declare function isCloudAPIErrorResponse(obj: unknown): obj is CloudAPIErrorResponse;
export declare function handleAPIErrors(label: string, e: AxiosError): void;
/**
* Login and obtain user credentials.
* First checks if the credentials exist and not expired.
* If so, returns the credentials.
* If not, try to login the user.
* If the user is not registered, prompts to register the user.
* @param {string} host - The DBOS Cloud host to authenticate against.
* @returns {DBOSCloudCredentials} - The user's DBOS Cloud credentials.
*/
export declare function getCloudCredentials(host: string, logger: Logger, userName?: string, secret?: string): Promise;
//# sourceMappingURL=cloudutils.d.ts.map