import { OnModuleInit } from '@nestjs/common'; import { PrismaClient } from '@prisma/client'; import { Cache } from '../../cache'; import { AppRuntimeConfigModules, FlattenedAppRuntimeConfig } from '../types'; /** * runtime.fetch(k) // v1 * runtime.fetchAll(k1, k2, k3) // [v1, v2, v3] * runtime.set(k, v) * runtime.update(k, (v) => { * v.xxx = 'yyy'; * return v * }) */ export declare class Runtime implements OnModuleInit { private readonly db; private readonly cache; private readonly logger; constructor(db: PrismaClient, cache: Cache); onModuleInit(): Promise; fetch(k: K): Promise; fetchAll(selector: Selector): Promise<{ [Key in keyof Selector]: FlattenedAppRuntimeConfig[Key]; }>; list(module?: AppRuntimeConfigModules): Promise<{ id: string; type: import(".prisma/client").$Enums.RuntimeConfigType; module: string; key: string; value: import(".prisma/client").Prisma.JsonValue; description: string; updatedAt: Date; deletedAt: Date | null; lastUpdatedBy: string | null; }[]>; set(key: K, value: V): Promise<{ id: string; type: import(".prisma/client").$Enums.RuntimeConfigType; module: string; key: string; value: import(".prisma/client").Prisma.JsonValue; description: string; updatedAt: Date; deletedAt: Date | null; lastUpdatedBy: string | null; }>; update(k: K, modifier: (v: V) => V | Promise): Promise; loadDb(k: K): Promise; loadCache(k: K): Promise; setCache(k: K, v: FlattenedAppRuntimeConfig[K]): Promise; /** * Upgrade the DB with latest runtime configs */ private upgradeDB; } //# sourceMappingURL=service.d.ts.map