///
export interface CacheOptions {
/** Storage Options from Redis */
storageOptions: {
/** Hostname / Domain / IpAddress */
host?: string;
/** POrt of the Host */
port?: number;
/** Password of the host */
password?: string;
/** Timeout of the host when to stop the connection */
timeout?: number;
/** If undefined | <= 0 then no Pool will be used */
min_conn?: number;
/** Max connections for a pool */
max_conn?: number;
/** If tls is used for authentication. */
tls?: {
key: Buffer;
cert: Buffer;
};
};
/** IF I should cache all Models */
useAllModels: boolean;
/** All Query-Actions to use on default. it will cache if the query action is inside of this or inside of the correct toCache Element */
defaultCacheActions?: string[];
/** If it should use a ttl on default if the cache Action does not have a ttl / if useAllModels == true */
defaultTTL?: number;
/** If there should be debug logs */
debug?: boolean;
/** All cache elements, if you don't wanna use useALlModels and defaultCacheActions */
toCache: {
/** all models to use () */
model: string;
/** all actions to use the cache on */
actions: string[];
/** Time to live in seconds */
ttl?: number;
/** Prefix for the cache key */
prefix?: string;
}[];
}
export declare type MiddlewareParameters = {
model?: string;
action: string;
args: any;
dataPath: string[];
runInTransaction: boolean;
};
export declare const defaultMutationMethods: string[];
export declare function prismaDragonflyRedisCache(options: CacheOptions): (params: MiddlewareParameters, next: (params: MiddlewareParameters) => Promise) => Promise;
/**
* extract redis options of a redis connect uri. e.g: "redis://username:password@hostname:port"
* @param str
* @returns object for redis authentication
*/
export declare function getRedisDataOfURL(str: string): {
username: string | string[];
password: any;
host: any;
port: string | string[];
};