@telepilotco/n8n-nodes-kv-storage
Version:
Key-Value Storage Node for n8n supporting different scopes
40 lines (39 loc) • 1.49 kB
TypeScript
import 'reflect-metadata';
import { IDataObject } from 'n8n-workflow';
export declare enum Scope {
ALL = "ALL",
EXECUTION = "EXECUTION",
WORKFLOW = "WORKFLOW",
INSTANCE = "INSTANCE"
}
export declare enum EventType {
ANY = "ANY",
ADDED = "added",
UPDATED = "updated",
DELETED = "deleted"
}
export declare class KvStorageService {
private map;
private mapExpiration;
private workflowListenersMap;
private instanceListeners;
private executionListeners;
private allListeners;
constructor();
private deleteExpiredEntries;
listAllKeyValuesInAllScopes(): IDataObject;
listAllKeysInScope(scope: Scope, specifier?: string): IDataObject;
listAllKeyValuesInScope(scope: Scope, specifier?: string): IDataObject;
deleteKeyWithScopedKey(scopedKey: string): IDataObject;
deleteKey(key: string, scope: Scope, specifier?: string): IDataObject;
getValue(key: string, scope: Scope, specifier?: string): IDataObject;
incrementValue(key: string, scope: Scope, specifier?: string, ttl?: number): IDataObject;
setValue(key: string, val: string, scope: Scope, specifier?: string, ttl?: number): IDataObject;
private sendEvent;
private composeScopeKey;
private getKey;
private getScope;
private getSpecifier;
addListener(scope: Scope, specifier: string, callback: (a: IDataObject) => void): void;
removeListener(scope: Scope, specifier: string, callback: (a: IDataObject) => void): void;
}