jsc8
Version:
The official Macrometa JavaScript SDK.
131 lines • 5.29 kB
TypeScript
import { C8QLLiteral, C8QLQuery } from "./c8ql-query";
import { C8Collection, DocumentCollection, EdgeCollection } from "./collection";
import { Config, Connection } from "./connection";
import { ArrayCursor } from "./cursor";
import { Graph } from "./graph";
import { Tenant } from "./tenant";
import { Stream } from "./stream";
import { Route } from "./route";
import { Event } from "./event";
import User from "./user";
import { Streamapps } from "./streamapps";
export type TenantListObj = {
tenant: string;
active: boolean;
extra: any;
};
export type TenantList = {
error: boolean;
code: number;
result: TenantListObj[];
};
export type EdgeLocation = {
_id: string;
_key: string;
_rev: string;
host: string;
local: boolean;
name: string;
port: number;
spot_region: boolean;
status: 0 | 1;
tags: {
city: string;
countrycode: string;
countryname: string;
latitude: string;
longitude: string;
role: string;
url: string;
};
};
export type ServiceOptions = {
[key: string]: any;
configuration?: {
[key: string]: any;
};
dependencies?: {
[key: string]: any;
};
};
export interface CreateFabricOptions {
dcList: string;
spotDc?: string;
metadata?: object;
}
export declare class Fabric {
protected _connection: Connection;
constructor(config?: Config);
get name(): string | null;
route(path?: string, headers?: Object): Route;
close(): void;
useFabric(fabricName: string): this;
useBearerAuth(token: string): this;
useBasicAuth(username: string, password: string): this;
setResultListener(callback: ((res: any) => void) | undefined): void;
get(): Promise<any>;
exists(): Promise<boolean>;
createFabric(fabricName: string, users: string[] | undefined, options: CreateFabricOptions): Promise<any>;
listFabrics(): Promise<any>;
listUserFabrics(): Promise<any>;
dropFabric(fabricName: string): Promise<any>;
getGeoFabricMetaData(): Promise<any>;
setMetaDataForGeoFabric(metadata: any): Promise<any>;
updateMetaDataForGeoFabric(metadata: any): Promise<any>;
login(email: string, password: string): Promise<object>;
updateFabricSpotRegion(tenantName: string, fabricName: string, datacenter?: string): Promise<any>;
getEvents(): Promise<any>;
deleteEvents(eventIds: string[]): Promise<any>;
event(entityName: string, eventId?: number): Event;
collection(collectionName: string): DocumentCollection;
edgeCollection(collectionName: string): EdgeCollection;
listCollections(excludeSystem?: boolean): Promise<any>;
collections(excludeSystem?: boolean): Promise<C8Collection[]>;
truncate(excludeSystem?: boolean): Promise<any[]>;
graph(graphName: string): Graph;
listGraphs(): Promise<any>;
graphs(): Promise<Graph[]>;
query(query: string | C8QLQuery | C8QLLiteral): Promise<ArrayCursor>;
query(query: C8QLQuery, opts?: any): Promise<ArrayCursor>;
query(query: string | C8QLLiteral, bindVars?: any, opts?: any): Promise<ArrayCursor>;
nextBatchFromCursor(cursorIdentifier: number): Promise<any>;
deleteCursor(cursorIdentifier: number): Promise<any>;
validateQuery(query: string): Promise<any>;
explainQuery(explainQueryObj: C8QLQuery): Promise<any>;
getCurrentQueries(): Promise<any>;
clearSlowQueries(): Promise<any>;
getSlowQueries(): Promise<any>;
terminateRunningQuery(queryId: string): Promise<any>;
listFunctions(): Promise<any>;
createFunction(name: string, code: string, isDeterministic?: boolean): Promise<any>;
dropFunction(name: string, group?: boolean): Promise<any>;
version(details?: boolean): Promise<any>;
useTenant(tenantName: string): this;
tenant(email: string, tenantName?: string): Tenant;
listTenants(): Promise<any>;
stream(streamName: string, local?: boolean, isCollectionStream?: boolean): Stream;
getStreams(global?: boolean | undefined): Promise<any>;
getAllStreams(): Promise<any>;
listPersistentStreams(local?: boolean): Promise<any>;
clearBacklog(): Promise<any>;
clearSubscriptionBacklog(subscription: string): Promise<any>;
unsubscribe(subscription: string): Promise<any>;
getAllEdgeLocations(): Promise<any>;
getTenantEdgeLocations(): Promise<any>;
getLocalEdgeLocation(): Promise<any>;
changeEdgeLocationSpotStatus(dcName: string, isSpot: boolean): Promise<any>;
user(user: string, email?: string): User;
getAllUsers(): Promise<any>;
listSavedQueries(): Promise<any>;
saveQuery(name: string, parameter: any, value: string, type: string): Promise<any>;
executeSavedQuery(queryName: string, opts?: any): Promise<any>;
updateSavedQuery(queryName: string, parameter: any, value: string, type: string): Promise<any>;
deleteSavedQuery(queryName: string): Promise<any>;
getNextBatchFromCursor(id: string): Promise<any>;
streamApp(appName: string): Streamapps;
createStreamApp(regions: Array<string>, appDefinition: string): Promise<any>;
getAllStreamApps(): Promise<any>;
validateStreamappDefinition(appDefinition: string): Promise<any>;
getSampleStreamApps(): Promise<any>;
}
//# sourceMappingURL=fabric.d.ts.map