/** * Best-effort cache for the SDK. * * The SDK uses this to avoid re-fetching values it can recreate, primarily * client_credentials access tokens. Cache entries may disappear at any time: * a miss is normal and callers must be able to rebuild the value. * * The default cache is in-memory. When the CLI package is installed, the SDK * can opportunistically use its filesystem + keychain cache. Browser and * minimal server deployments fall back to memory unless a caller injects a * Redis, database, or environment-specific cache. * * Secrets: adapters receive a `secret: true` flag on `set` and decide * what to do with it (keychain for the filesystem adapter; ignored for * the in-memory adapter; user adapters can throw, plaintext, encrypt — * their call). The value returned by `get` is always the plain secret. */ export interface ZapierCacheEntry { value: string; /** Millisecond epoch. Undefined means "no expiration recorded." */ expiresAt?: number; } export interface ZapierCacheSetOptions { /** * Hint that this value is sensitive. Adapters may use a more secure * backend (e.g. the OS keychain for the filesystem adapter); adapters * without a secure backend may throw, warn, or accept — their call. */ secret?: boolean; /** Time-to-live in seconds from now. */ ttl?: number; } export interface ZapierCache { get(key: string): Promise; set(key: string, value: string, options?: ZapierCacheSetOptions): Promise; delete(key: string): Promise; /** * Optional mutex for caches that can coordinate beyond one JavaScript * process. The SDK re-checks the cache inside the lock before rebuilding. */ withLock?(key: string, fn: () => Promise): Promise; } /** * Simplest possible adapter: a Map. No persistence, no locking (single * process only), no differentiation between secrets and non-secrets. * This is the default when cli-login isn't installed and no custom * cache is provided. */ export declare function createMemoryCache(): ZapierCache; //# sourceMappingURL=cache.d.ts.map