import { type OcppRequest, type OcppResponse, type SystemConfig } from '@citrineos/types'; import type { ICache } from '../cache/cache.js'; import type { IOcppSender, SendCallArgs, SendCallErrorArgs, SendCallResultArgs } from './i-ocpp-sender.js'; import { type IMessage, type IMessageConfirmation, type IMessageSender } from '../messages/index.js'; import { OCPPValidator } from '../modules/ocpp-validator.js'; import { OcppError } from '../../ocpp/rpc/message.js'; import { type ILogObj, Logger } from 'tslog'; /** * OcppSender is primarily for abstracting any OCPP message calls that * {@link AbstractHandler}s may use when processing OCPP messages. */ export declare class OcppSender implements IOcppSender { private readonly CALLBACK_URL_CACHE_PREFIX; protected _config: SystemConfig; protected _ocppValidator: OCPPValidator; protected readonly _cache: ICache; protected readonly _sender: IMessageSender; protected readonly _logger: Logger; constructor({ config, cache, sender, logger, ocppValidator, }: { config: SystemConfig; cache: ICache; sender: IMessageSender; logger?: Logger; ocppValidator?: OCPPValidator; }); /** * Sends a call with the specified identifier, tenantId, protocol, action, payload, and origin. * * @return {Promise} A promise that resolves to the message confirmation. */ sendCall({ ocppConnectionName, tenantId, protocol, action, eventGroup, payload, callbackUrl, correlationId, origin, }: SendCallArgs): Promise; /** * Sends the call result message and returns a Promise that resolves with the confirmation message. * * @return {Promise} A Promise that resolves with the confirmation message. */ sendCallResult({ correlationId, ocppConnectionName, tenantId, protocol, action, eventGroup, payload, origin, }: SendCallResultArgs): Promise; /** * Sends the call result using the request message's fields. * Payload will overwrite message.payload. * * @param {IMessage} message - The request message object. * @param {OcppResponse} payload - The payload to send. * @return {Promise} A promise that resolves to the message confirmation. */ sendCallResultWithMessage(message: IMessage, payload: OcppResponse): Promise; /** * Sends the call error message and returns a Promise that resolves with the confirmation message. * * @return {Promise} A Promise that resolves with the confirmation message. */ sendCallError({ correlationId, ocppConnectionName, tenantId, protocol, action, eventGroup, payload, origin, }: SendCallErrorArgs): Promise; /** * Sends the call error using the request message's fields. * Payload will overwrite message.payload. * * @param {IMessage} message - The request message object. * @param {OcppResponse} payload - The payload to send. * @return {Promise} A promise that resolves to the message confirmation. */ sendCallErrorWithMessage(message: IMessage, payload: OcppError): Promise; /** * Initializes the logger for the class. * * @return {Logger} The initialized logger. */ protected _initLogger(baseLogger?: Logger): Logger; }