@reshuffle/monday-redis-service
Version:
Reshuffle service for mirroring Monday to Redis
54 lines (53 loc) • 2.3 kB
TypeScript
import { RedisConnector } from 'reshuffle-redis-connector';
import { MondayConnector } from 'reshuffle-monday-connector';
import { BaseConnector, Reshuffle } from 'reshuffle-base-connector';
declare type MondayItem = Record<string, any>;
interface Options {
boardName: string;
monday: MondayConnector;
redis: RedisConnector;
encryptionKey?: string;
encryptedColumnList?: string[];
apiUserIdsToIgnoreOnNewEvent?: string[];
}
export declare class MondayRedisService extends BaseConnector {
readonly boardName: string;
readonly monday: MondayConnector;
readonly redis: RedisConnector;
private boardId?;
private readonly keyBase;
private readonly namesKey;
private readonly changesKey;
private readonly cipher?;
private encryptedColumns;
private destageIntervalID;
private mondaySyncIntervalID;
constructor(app: Reshuffle, options: Options, id?: string);
private resetDestageInterval;
private resetMondaySync;
private getChangeKey;
private syncBoardItemAdditionDeletion;
private destageChanges;
private destageOneChange;
private keyForItem;
private getBoardItemIds;
private serialize;
private deserialize;
private getMondayBoardItems;
private createItemInRedis;
private deleteItemInRedis;
private updateColumnValue;
initialize(): Promise<MondayRedisService>;
createItem(name: string, columnValues: Record<string, any>): Promise<MondayItem>;
getBoardId(): Promise<number>;
getBoardItems(): Promise<MondayItem[]>;
getBoardItemById(itemId: string): Promise<MondayItem | undefined>;
getBoardItemByName(name: string): Promise<MondayItem | undefined>;
setColumnValue(itemId: string, title: string, value: any): Promise<void>;
setItemName(itemId: string, name: string): Promise<void>;
incrColumnValue(itemId: string, title: string, incr?: number): Promise<void>;
static validateId(itemId: string): string;
static validateBoardName(name: string): string;
}
export declare function createAndInitializeMondayRedisService(app: Reshuffle, boardName: string, monday: MondayConnector, redis: RedisConnector, encryptionKey?: string, encryptedColumnList?: string[], apiUserIdsToIgnoreOnNewEvent?: string[]): Promise<MondayRedisService>;
export {};