import { Execution } from '../engine/Execution'; import { IDataStore, IBPMNServer, IInstanceData, IItemData } from '../interfaces'; import { ServerComponent } from '../server/ServerComponent'; import { JSONDB } from './JSONDB'; declare class JSONDataStore extends ServerComponent implements IDataStore { dbConfiguration: any; db: JSONDB; execution: Execution; isModified: boolean; isRunning: boolean; inSaving: boolean; promises: any[]; locker: any; enableSavePoints: boolean; constructor(server: IBPMNServer); save(instance: any, options?: {}): Promise; loadInstance(instanceId: any, options?: {}): Promise<{ instance: IInstanceData; items: any[]; }>; private getItemsFromInstances; static seq: number; private saveInstance; findItem(query: any): Promise; findInstance(query: any, options: any): Promise; convertObj(obj: any, cls: any): any; convertColl(coll: any, cls: any): void; /** * * @param query * @param option * -'summary' minimal data * - 'full' * - {projection,sort} * @returns */ findInstances(query: any, option?: 'summary' | 'full' | any): Promise; /** * scenario: * * ``` * itemId { items { id : value } } * itemKey { items {key: value } } * instance, task { instance: { id: instanceId }, items: { elementId: value }} * message { items: { messageId: nameofmessage, key: value } {} * status { items: {status: 'wait' } } * custom: { query: query, projection: projection } * ``` * New approach: * just like MongoDB * ``` * itemId { items { id : value } } * itemKey { items {key: value } } * instance, task { id: instanceId , items.elementId: value } * message { items.messageId: nameofmessage, key: value } {} * status { items.status: 'wait' } } * custom: { query: query, projection: projection } * ``` * Problem with Mongodb: `projection $elematch returns only the first record` * * @param query */ findItems(query: any): Promise; deleteInstances(query: any): Promise; /** * first time installation of DB * * creates a new collection and add an index * * */ install(): Promise; archive(query: any): Promise; updateSource(id: any, source: any): Promise; } export { JSONDataStore };