@ultipa-graph/ultipa-driver
Version:
NodeJS SDK for ultipa-server 5.2
46 lines (45 loc) • 2.65 kB
TypeScript
import { QueryReply, Status, ResultAlias, EntityTable, Path, Table, Value, Schema, Property, ExplainPlan, Attr } from "../proto/ultipa_pb";
import * as ULTIPA from "../types/types";
import { Alias } from "../types/types";
export declare const mergeQueryResponse: (res1: ULTIPA.Response, res2: ULTIPA.Response) => ULTIPA.Response;
export declare const FormatType: {
queryResponse: (res: QueryReply, timezone: ULTIPA.Timezone) => ULTIPA.Response;
status: (statusData: Status, p?: {
host: string;
}) => ULTIPA.Status;
alias: (resultAlias: ResultAlias[]) => ULTIPA.Alias[];
keyValue: (keyValuesData: Value[]) => object;
paths: (paths: Path[]) => ULTIPA.Path[];
graph: (paths: Path[], timezone: ULTIPA.Timezone) => ULTIPA.Graph;
explainPlan: (data: ExplainPlan) => ULTIPA.ExplainPlan;
table: (tableData: Table, timezone: ULTIPA.Timezone) => ULTIPA.Table;
tables: (tablesData: Table[], timezone: ULTIPA.Timezone) => ULTIPA.Table[];
toEdgeTable: (propertyTypeObject: object, schemaName: string, headers: string[], rows: string[][], timezone: ULTIPA.Timezone) => EntityTable;
toPropertyTypeObject: (properties: ULTIPA.Property[]) => {};
toNodeTable: (propertyTypeObject: object, schemaName: string, headers: string[], rows: string[][], timezone: ULTIPA.Timezone) => EntityTable;
toEdgeTableWithSchema: (schema: ULTIPA.Schema, rows: ULTIPA.Edge[], timezone: ULTIPA.Timezone) => EntityTable;
toNodeTableWithSchema: (schema: ULTIPA.Schema, rows: ULTIPA.Node[], timezone: ULTIPA.Timezone) => EntityTable;
uuids: (tableData: EntityTable) => string[];
nodeTable: (nodeTableData: EntityTable, timezone: ULTIPA.Timezone) => ULTIPA.Node[];
edgeTable: (edgeTableData: EntityTable, timezone: ULTIPA.Timezone) => ULTIPA.Edge[];
attr(attr: Attr, timezone: ULTIPA.Timezone): ULTIPA.Attr;
graphPrivileges(graphPrivileges: object[]): any[];
};
export interface ResponseKeyFormat {
jsonKeys?: string[];
boolKeys?: string[];
keyReplace?: object;
dataFormat?: Function;
mockData?: {
tables?: any[];
};
}
export declare const FormatResponse: {
tableToArray: (table: ULTIPA.Table) => any[];
formatObjects: (objs: object[], keysFormat?: ResponseKeyFormat) => any[];
formatObject: (_obj: object, keysFormat?: ResponseKeyFormat) => {};
successStatus: () => ULTIPA.Status;
statisticsSum: (one?: ULTIPA.Statistics, sumOne?: ULTIPA.Statistics) => ULTIPA.Statistics;
unknownError: (err: any, res: ULTIPA.Response) => ULTIPA.Response;
catchUltipaUqlError: (error: Error) => ULTIPA.Response;
};