import type { LogDeduper } from './log-deduper.js'; export type LogLevelString = 'info' | 'warn' | 'error'; /** * dedupeKey - key used to deduplicate log entries when a LogDeduper is injected into the MMConnectorLogger * * A recommended practice is to use a meaningful unique identifier for this log entry type. * Examples: SyncFromERPCompleted * SyncFromERPError:HTTPError */ export declare class LogEntry { level: LogLevelString; message: string; dedupeKey: string; eventTime: number; constructor(params: { level: LogLevelString; message: string; dedupeKey: string; }); } /** * The response from the MM connector logging API */ export interface LogResponse { message: string; processed?: number; } /** * MM Connector Logger for sending progress and error updates to the MM cloud * * This class provides helper methods to send individual logs to the * MM connector logging API, providing support for validation, retries, and error handling * according to the API specification. * * By injecting a LogDeduper, the log entries are deduplicated across jobs over a specified time window */ export declare class MMConnectorLogger { private readonly MAX_MSG_LEN; private mmApiClient; private readonly deduper?; private readonly source; constructor(source: string, deduper?: LogDeduper); /** * Send a single log entry to the MM cloud with deduplication. * * The deduplication is handled by the injected LogDeduper. * If no deduper is injected, the log entry is sent without deduplication. * * The standard deduper, FileLogDeduper, stores the deduplication state in a file, * allowing deduplication across jobs, * * @param logEntry - The log entry to send * @returns Promise resolving to the API response or null if suppressed * @throws HTTPError if the request fails or Error if the log entry is invalid */ sendLog(logEntry: LogEntry): Promise; /** * @throws Error if validation fails */ private validateLogEntry; /** * Retry all failed transmissions silently * This method attempts to retry all messages that failed to transmit * and removes them from the failed list if successful, else leaves them for the client to retry * * Expected usage is by a client to call this as part of its own retry mechanism */ retryFailedTransmissions(): Promise; /** * Clean up resources */ destroy(): Promise; } //# sourceMappingURL=mm-connector-logger.d.ts.map