/** * Log file listing operations. */ import type { B2CInstance } from '../../instance/index.js'; import type { ListLogsOptions, LogFile } from './types.js'; /** * Extracts the log prefix from a filename. * * @param filename - Log file name (e.g., "error-blade1-20250125.log") * @returns The prefix (e.g., "error") or "unknown" * * @example * extractPrefix("error-blade1-20250125.log") // "error" * extractPrefix("customerror-blade1-20250125.log") // "customerror" * extractPrefix("custom-mylog-blade1-20250125.log") // "custom-mylog" */ export declare function extractPrefix(filename: string): string; /** * Lists log files on a B2C Commerce instance. * * Filters in {@link ListLogsOptions.prefixes} are matched in one of two ways: * * - **Prefix filters** (no `/`, e.g. `"error"`) match the extracted log-category * prefix of files in the top-level `Logs/` directory. * - **Path filters** (contain a `/`, e.g. `"internal/server"`) recurse into the * named subdirectory of `Logs/` and match against each file's path relative to * `Logs/`. This is the only case that lists subdirectories — by default only the * top-level `Logs/` directory is scanned. * * @param instance - B2C instance to list logs from * @param options - Listing options (filters, sorting) * @returns Array of log files * * @example * ```typescript * // List all error and customerror logs (top-level) * const logs = await listLogFiles(instance, { * prefixes: ['error', 'customerror'], * sortBy: 'date', * sortOrder: 'desc' * }); * * // List server logs in the internal/ subdirectory * const internal = await listLogFiles(instance, {prefixes: ['internal/server']}); * ``` */ export declare function listLogFiles(instance: B2CInstance, options?: ListLogsOptions): Promise;