const moduleName = 'OCPPRequestService';
+const defaultRequestParams: RequestParams = {
+ skipBufferingOnError: false,
+ triggerMessage: false,
+ throwError: false,
+};
+
export abstract class OCPPRequestService {
private static instance: OCPPRequestService | null = null;
private readonly version: OCPPVersion;
messageId: string,
messagePayload: JsonType,
commandName: RequestCommand,
- params: RequestParams = {
- skipBufferingOnError: false,
- triggerMessage: false,
- throwError: false,
- }
+ params: RequestParams = defaultRequestParams
): Promise<ResponseType> {
params = {
- ...{ skipBufferingOnError: false, triggerMessage: false, throwError: false },
+ ...defaultRequestParams,
...params,
};
try {
messagePayload: JsonType | OCPPError,
messageType: MessageType,
commandName: RequestCommand | IncomingRequestCommand,
- params: RequestParams = {
- skipBufferingOnError: false,
- triggerMessage: false,
- throwError: false,
- }
+ params: RequestParams = defaultRequestParams
): Promise<ResponseType> {
params = {
- ...{ skipBufferingOnError: false, triggerMessage: false, throwError: false },
+ ...defaultRequestParams,
...params,
};
if (