mongodb-build-info
Version:
Extract information from mongodb's buildInfo
38 lines • 1.59 kB
TypeScript
type Document = Record<string, unknown>;
export declare function getDataLake(buildInfo: unknown): {
isDataLake: boolean;
dlVersion: string | null;
};
export declare function isEnterprise(buildInfo: unknown): boolean;
export declare function isAtlas(uri: string): boolean;
type IsLocalAtlasCountFn = (db: string, ns: string, query: Record<string, unknown>) => Promise<number>;
export declare function isLocalAtlas(countFn: IsLocalAtlasCountFn): Promise<boolean>;
export declare function isAtlasStream(uri: string): boolean;
export declare function isLocalhost(uri: string): boolean;
export declare function isDigitalOcean(uri: string): boolean;
export declare function getGenuineMongoDB(uri: string): {
isGenuine: boolean;
serverName: string;
};
type IdentifyServerNameOptions = {
connectionString: string;
adminCommand: (command: Document) => Promise<Document>;
};
export declare function identifyServerName({ connectionString, adminCommand, }: IdentifyServerNameOptions): Promise<string>;
export declare function getBuildEnv(buildInfo: unknown): {
serverOs: string | null;
serverArch: string | null;
};
declare const _default: {
getDataLake: typeof getDataLake;
isEnterprise: typeof isEnterprise;
isAtlas: typeof isAtlas;
isAtlasStream: typeof isAtlasStream;
isLocalhost: typeof isLocalhost;
isDigitalOcean: typeof isDigitalOcean;
getGenuineMongoDB: typeof getGenuineMongoDB;
identifyServerName: typeof identifyServerName;
getBuildEnv: typeof getBuildEnv;
};
export default _default;
//# sourceMappingURL=index.d.ts.map