import type { SparqlQueryAdapterOptions } from './storage/query-adapter/sparql/SparqlQueryAdapterOptions'; import type { Callbacks } from './util/Types'; export type ReadCacheOperation = 'find' | 'findBy' | 'findAll' | 'count'; export interface ReadCacheStore { get: (key: string) => Promise; set: (key: string, value: unknown, ttlMs: number) => Promise; delete?: (key: string) => Promise; clear?: () => Promise; } export interface ReadCachePolicyInput { operation: ReadCacheOperation; args: readonly unknown[]; endpointUrl?: string; namespace?: string; } export interface ReadCachePolicyDecision { cache: boolean; ttlMs?: number; keyHint?: string; } export type ReadCachePolicy = (input: ReadCachePolicyInput) => ReadCachePolicyDecision; export type SklEngineOptions = SparqlQueryAdapterOptions & { /** * Callbacks to execute upon events. */ readonly callbacks?: Callbacks; /** * Manually defined functions which can be used in mappings. */ readonly functions?: Record any>; /** * When true, disables validation of verb parameters and return values according to schemas */ readonly disableValidation?: boolean; /** * An object containing files keyed on their title that can be used in mappings. */ readonly inputFiles?: Record; readonly debugMode?: boolean; /** * The path to the executor script. */ readonly scriptPath?: string; /** * Optional read cache store used for select read operations. * Cache decisions are made by readCachePolicy. */ readonly readCache?: ReadCacheStore; /** * Optional policy that decides whether a given read operation should be cached. */ readonly readCachePolicy?: ReadCachePolicy; /** * Optional namespace to scope cache keys (for example tenant/account isolation). */ readonly readCacheNamespace?: string; };