@visactor/vmind
Version:
<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu
41 lines (40 loc) • 2.08 kB
TypeScript
import type { DataItem, DataTable, FieldInfo } from '../../types';
import { ROLE } from '../../types';
export declare function generateRandomString(len: number): string;
export declare const parseSQLResponse: (response: string) => {
sql: string;
llmFieldInfo: any;
thoughts: string;
};
export declare function removeEmptyLines(str: string): string;
export declare const swapMap: (map: Map<string, string>) => Map<any, any>;
export declare const replaceByMap: (str: string, replaceMap: Map<string, string>) => string;
export declare const replaceString: (str: string | number, replaceMap: Map<string, string>) => string | number;
export declare const replaceDataset: (dataset: DataTable, replaceMap: Map<string, string>, keysOnly: boolean) => DataTable;
export declare const getValueByAttributeName: (obj: any, outterKey: string) => string[];
export declare const replaceInvalidWords: (sql: string, columns: string[]) => {
validStr: string;
columnReplaceMap: Map<string, string>;
sqlReplaceMap: Map<any, any>;
};
export declare const mergeMap: (map1: Map<string, string>, map2: Map<string, string>) => Map<string, string>;
export declare const matchColumnName: (columnName: string, fieldName: string) => boolean;
export declare const replaceBlankSpace: (sql: string, fieldNames: string[]) => string;
export declare const sumAllMeasureFields: (sql: string, fieldInfo: FieldInfo[], columnReplaceMap: Map<string, string>, sqlReplaceMap: Map<string, string>) => string;
export declare const convertGroupByToString: (sql: string, dataset: DataItem[]) => void;
export declare const parseRespondField: (responseFieldInfo: {
fieldName: string;
description?: string;
}[], dataset: DataItem[]) => {
fieldName: string;
alias?: string;
description?: string;
type: import("../../types").DataType;
role: ROLE;
location?: ROLE;
dataExample?: import("../../types").DataCell[];
domain?: (string | number)[];
unit?: string;
ratioGranularity?: "%" | "‰";
dateGranularity?: "year" | "quarter" | "month" | "week" | "day";
}[];