@akomalabs/kemono
Version:
A production-grade TypeScript API wrapper for the Kemono/Coomer platforms
84 lines (83 loc) • 1.96 kB
TypeScript
export type KemonoBaseUrl = 'https://kemono.su/api/v1' | 'https://coomer.su/api/v1';
/**
* Configuration options for the Kemono API client
* @interface KemonoConfig
*/
export interface KemonoConfig {
/**
* Base URL for the API (defaults to 'https://kemono.su/api/v1')
*/
baseUrl?: KemonoBaseUrl;
/**
* Session key for authentication (required for favorites endpoints)
*/
sessionKey?: string;
/**
* Cache configuration
*/
cache?: {
/**
* Enable caching (defaults to false)
*/
enabled: boolean;
/**
* TTL for cached items in seconds (defaults to 300)
*/
ttl?: number;
/**
* Redis configuration if using Redis cache
*/
redis?: {
host: string;
port: number;
password?: string;
};
};
/**
* Rate limiting configuration
*/
rateLimit?: {
/**
* Maximum number of requests per window (defaults to 100)
*/
maxRequests: number;
/**
* Time window in seconds (defaults to 60)
*/
windowMs: number;
};
/**
* Retry configuration
*/
retry?: {
/**
* Maximum number of retries (defaults to 3)
*/
maxRetries: number;
/**
* Initial retry delay in milliseconds (defaults to 1000)
*/
initialDelayMs: number;
/**
* Maximum retry delay in milliseconds (defaults to 5000)
*/
maxDelayMs: number;
};
/**
* Logging configuration
*/
logging?: {
/**
* Enable logging (defaults to false)
*/
enabled: boolean;
/**
* Log level (defaults to 'info')
*/
level?: 'error' | 'warn' | 'info' | 'debug';
/**
* Custom logger instance
*/
logger?: any;
};
}