import { type OCPPResponseService, OCPPServiceUtils } from './internal';
import type { ChargingStation } from '../../charging-station';
import { OCPPError } from '../../exception';
-// import { PerformanceStatistics } from '../../performance';
-import { PerformanceStatistics } from '../../performance/PerformanceStatistics';
+import { PerformanceStatistics } from '../../performance';
import {
type EmptyObject,
type ErrorCallback,
type ResponseCallback,
type ResponseType,
} from '../../types';
-import { Constants } from '../../utils/Constants';
-import { logger } from '../../utils/Logger';
-import { Utils } from '../../utils/Utils';
+import { Constants, Utils, logger } from '../../utils';
const moduleName = 'OCPPRequestService';
ErrorType.GENERIC_ERROR,
`WebSocket closed or errored for buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
- (messagePayload as JsonObject)?.details ?? {}
+ (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT
)
);
} else if (wsClosedOrErrored) {
ErrorType.GENERIC_ERROR,
`WebSocket closed or errored for non buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
- (messagePayload as JsonObject)?.details ?? {}
+ (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT
);
// Reject response
if (messageType !== MessageType.CALL_MESSAGE) {
ErrorType.GENERIC_ERROR,
`Timeout for message id '${messageId}'`,
commandName,
- (messagePayload as JsonObject)?.details ?? {}
+ (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT
),
() => {
messageType === MessageType.CALL_MESSAGE && chargingStation.requests.delete(messageId);