UNPKG

@dataql/node

Version:

DataQL core SDK for unified data management with MongoDB and GraphQL - Production Multi-Cloud Ready

62 lines (61 loc) 1.66 kB
import { PluginUtils, RetryOptions } from "./types.js"; /** * Utility functions for DataQL plugins * * Provides common helper functions that plugins can use for * configuration validation, data manipulation, and other tasks. */ export declare class PluginUtilsImpl implements PluginUtils { /** * Generate a unique ID */ generateId(): string; /** * Validate configuration against a schema */ validateConfig(config: any, schema: any): boolean; /** * Merge configurations with deep merge */ mergeConfig(base: any, override: any): any; /** * Deep clone an object */ clone<T>(obj: T): T; /** * Check if object is empty */ isEmpty(obj: any): boolean; /** * Retry operation with backoff */ retry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>; /** * Sleep for specified milliseconds */ sleep(ms: number): Promise<void>; /** * Debounce a function */ debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void; /** * Throttle a function */ throttle<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void; /** * Get nested property value from object */ get(obj: any, path: string, defaultValue?: any): any; /** * Set nested property value in object */ set(obj: any, path: string, value: any): void; /** * Private: Deep merge two objects */ private deepMerge; /** * Private: Simple schema validation */ private validateObjectAgainstSchema; }