UNPKG

@citrineos/base

Version:

The base module for OCPP v2.0.1 including all interfaces. This module is not intended to be used directly, but rather as a dependency for other modules.

60 lines 1.91 kB
"use strict"; // Copyright (c) 2023 S44, LLC // Copyright Contributors to the CitrineOS Project // // SPDX-License-Identifier: Apache 2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.RequestBuilder = void 0; const __1 = require(".."); class RequestBuilder { static buildCall(stationId, correlationId, tenantId, action, payload, eventGroup, origin, protocol, timestamp = new Date()) { return { origin: origin, eventGroup: eventGroup, action, context: { stationId, correlationId, tenantId, timestamp: timestamp.toISOString(), }, state: __1.MessageState.Request, protocol, payload, }; } static buildCallResult(stationId, correlationId, tenantId, action, payload, eventGroup, origin, protocol, timestamp = new Date()) { return { origin: origin, eventGroup: eventGroup, action, context: { stationId, correlationId, tenantId, timestamp: timestamp.toISOString(), }, state: __1.MessageState.Response, protocol, payload, }; } static buildCallError(stationId, correlationId, tenantId, action, payload, eventGroup, origin, protocol, timestamp = new Date()) { return { origin: origin, eventGroup: eventGroup, action, context: { stationId, correlationId, tenantId, timestamp: timestamp.toISOString(), }, state: __1.MessageState.Response, protocol, payload, }; } } exports.RequestBuilder = RequestBuilder; //# sourceMappingURL=request.js.map