import { type PagedResult } from '../../api/ApiTypes'; import { type LogApiKey, type LogEventSkeleton } from '../../api/cloud/LogApi'; import { State } from '../../shared/State'; export type Log = { /** * Get default noise filter * @returns {string[]} array of default event types and loggers to be filtered out */ getDefaultNoiseFilter(): string[]; /** * Resolve log level to an array of effective log levels * @param level string or numeric log level: 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE', 'ALL', 0, 1, 2, 3, 4 * @returns {string[]} array of effective log levels */ resolveLevel(level: string | number): string[]; /** * Resolve a log event's level * @param {object} log log event * @returns {string} log level */ resolvePayloadLevel(log: LogEventSkeleton): string; /** * Get available log sources * @returns {Promise} promise resolving to an array of available log sources */ getLogSources(): Promise; /** * Get log api key * @param {string} keyId key id * @returns {Promise} promise resolving to a LogApiKey objects */ getLogApiKey(keyId: string): Promise; /** * Validate log api key and secret * @param {string} keyId log api key id * @param {string} secret log api secret * @returns {Promise} a promise resolving to true if the key is valid, false otherwise */ isLogApiKeyValid(keyId: string, secret: string): Promise; /** * Get log api keys * @returns {Promise} promise resolving to an array of LogApiKey objects */ getLogApiKeys(): Promise; /** * Create log api key * @param {string} keyName human-readable key name * @returns {Promise} a promise resolving to an object containing the log api key and secret */ createLogApiKey(keyName: string): Promise; /** * Delete log api key * @param {string} keyId key id * @returns {Promise} a promise resolving to an object containing the log api key */ deleteLogApiKey(keyId: string): Promise; /** * Delete all log api keys * @returns {Promise} a promise resolving to an array of log api key objects */ deleteLogApiKeys(): Promise; /** * Tail logs * @param {string} source log source(s) to tail * @param {string} cookie paged results cookie * @returns {Promise>} promise resolving to paged log event result */ tail(source: string, cookie: string): Promise>; /** * Fetch logs * @param {string} source log source(s) to tail * @param {string} startTs start timestamp * @param {string} endTs end timestamp * @param {string} cookie paged results cookie * @returns {Promise>} promise resolving to paged log event result */ fetch(source: string, startTs: string, endTs: string, cookie: string): Promise>; }; declare const _default: (state: State) => Log; export default _default; /** * Get default noise filter * @returns {string[]} array of default event types and loggers to be filtered out */ export declare function getDefaultNoiseFilter(): string[]; /** * Resolve log level to an array of effective log levels * @param level string or numeric log level: 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE', 'ALL', 0, 1, 2, 3, 4 * @returns {string[]} array of effective log levels */ export declare function resolveLevel(level: string | number): string[]; /** * Resolve a log event's level * @param {object} log log event * @returns {string} log level */ export declare function resolvePayloadLevel(log: LogEventSkeleton): string; /** * Get available log sources * @returns {Promise} promise resolving to an array of available log sources */ export declare function getLogSources({ state }: { state: State; }): Promise; /** * Get log API key * @returns {Promise>} a promise resolving to a log api key object */ export declare function getLogApiKey({ keyId, state, }: { keyId: string; state: State; }): Promise; /** * Validate log API key * @param {string} keyId log api key id * @param {string} secret log api secret * @returns {Promise} a promise resolving to true if the key is valid, false otherwise */ export declare function isLogApiKeyValid({ keyId, secret, state, }: { keyId: string; secret: string; state: State; }): Promise; /** * Get log api keys * @returns {Promise} promise resolving to an array of LogApiKey objects */ export declare function getLogApiKeys({ state, }: { state: State; }): Promise; /** * Create API key * @param {keyName: string, state: State} params keyName, state * @returns {Promise} new API key and secret */ export declare function createLogApiKey({ keyName, state, }: { keyName: string; state: State; }): Promise; /** * Delete key */ export declare function deleteLogApiKey({ keyId, state, }: { keyId: string; state: State; }): Promise; /** * Delete all keys */ export declare function deleteLogApiKeys({ state, }: { state: State; }): Promise; /** * Tail logs * @param {string} source log source(s) to tail * @param {string} cookie paged results cookie * @returns {Promise>} promise resolving to paged log event result */ export declare function tail({ source, cookie, state, }: { source: string; cookie: string; state: State; }): Promise>; /** * Fetch logs * @param {string} source log source(s) to tail * @param {string} startTs start timestamp * @param {string} endTs end timestamp * @param {string} cookie paged results cookie * @returns {Promise>} promise resolving to paged log event result */ export declare function fetch({ source, startTs, endTs, cookie, state, }: { source: string; startTs: string; endTs: string; cookie: string; state: State; }): Promise>; //# sourceMappingURL=LogOps.d.ts.map