type KVPrimitive = string | number | boolean | null; export type KVSerializable = KVPrimitive | Array | { [key: string]: KVSerializable; }; /** * KVStore provides a simple key-value storage mechanism for Attio apps. * It allows storing, retrieving, and deleting serializable values associated with string keys. */ export interface KVStore { /** * Stores a value in the key-value store. * * @param key - The unique identifier for the stored value * @param value - The value to store (must be JSON serializable) * @param options - Optional configuration * @param options.ttlInSeconds - Time-to-live in seconds, after which the value will expire * @throws Error if the operation fails or the value cannot be serialized */ set(key: string, value: KVSerializable, options?: { ttlInSeconds?: number; }): Promise; /** * Retrieves a value from the key-value store. * * @param key - The unique identifier for the stored value * @returns The stored value wrapped in an object {value: value}, or null if the key was not found * @throws Error if the operation fails or the value cannot be deserialized */ get(key: string): Promise<{ value: KVSerializable; } | null>; /** * Retrieves a list of values from the key-value store. * * @param keys - The unique identifiers for the stored values * @returns An object that maps the keys to their value, wrapped in an object {value: value}, or null if the key was not found * @throws Error if the operation fails or the values cannot be deserialized */ mget(keys: Array): Promise>; /** * Deletes a value from the key-value store. * * @param key - The unique identifier for the stored value to delete * @throws Error if the operation fails */ delete(key: string): Promise; } export declare const kv: KVStore; export {}; //# sourceMappingURL=kv-store.d.ts.map