IdTagDistribution,
type Status,
} from './AutomaticTransactionGenerator';
+export { type GenericResponse, GenericStatus, RegistrationStatusEnumType } from './ocpp/Common';
export {
AvailabilityType,
type BootNotificationRequest,
type DiagnosticsStatusNotificationResponse,
type ErrorResponse,
type FirmwareStatusNotificationResponse,
- GenericStatus,
- type GenericResponse,
type HeartbeatResponse,
type MeterValuesResponse,
- RegistrationStatusEnumType,
type Response,
type ResponseHandler,
type StatusNotificationResponse,
import type { OCPP16ChargingSchedule } from './ChargingProfile';
import type { EmptyObject } from '../../EmptyObject';
import type { JsonObject } from '../../JsonType';
+import type { GenericStatus, RegistrationStatusEnumType } from '../Common';
import type { OCPPConfigurationKey } from '../Configuration';
-import { GenericStatus, type RegistrationStatusEnumType } from '../Responses';
export interface OCPP16HeartbeatResponse extends JsonObject {
currentTime: Date;
import type { JsonObject } from '../../JsonType';
-import type { GenericStatus } from '../Responses';
+import type { GenericStatus } from '../Common';
export enum DataEnumType {
// eslint-disable-next-line id-blacklist
import type { OCPP20SetVariableResultType } from './Variables';
import type { EmptyObject } from '../../EmptyObject';
import type { JsonObject } from '../../JsonType';
-import type { RegistrationStatusEnumType } from '../Responses';
+import type { RegistrationStatusEnumType } from '../Common';
export type OCPP20BootNotificationResponse = {
currentTime: Date;
--- /dev/null
+import type { JsonObject } from '../JsonType';
+
+export enum GenericStatus {
+ Accepted = 'Accepted',
+ Rejected = 'Rejected',
+}
+
+export interface GenericResponse extends JsonObject {
+ status: GenericStatus;
+}
+
+export enum RegistrationStatusEnumType {
+ ACCEPTED = 'Accepted',
+ PENDING = 'Pending',
+ REJECTED = 'Rejected',
+}
export type IncomingRequest = [MessageType.CALL_MESSAGE, string, IncomingRequestCommand, JsonType];
+export type IncomingRequestHandler = (
+ chargingStation: ChargingStation,
+ commandPayload: JsonType,
+) => JsonType | Promise<JsonType>;
+
export type ResponseCallback = (payload: JsonType, requestPayload: JsonType) => void;
export type ErrorCallback = (error: OCPPError, requestStatistic?: boolean) => void;
export type FirmwareStatusNotificationRequest = OCPP16FirmwareStatusNotificationRequest;
-export type IncomingRequestHandler = (
- chargingStation: ChargingStation,
- commandPayload: JsonType,
-) => JsonType | Promise<JsonType>;
-
export const AvailabilityType = {
...OCPP16AvailabilityType,
...OperationalStatusEnumType,
OCPP16UnlockStatus,
} from './1.6/Responses';
import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses';
+import { type GenericResponse, GenericStatus } from './Common';
import type { ErrorType } from './ErrorType';
import type { MessageType } from './MessageType';
import type { ChargingStation } from '../../charging-station';
-import type { JsonObject, JsonType } from '../JsonType';
+import type { JsonType } from '../JsonType';
export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType];
export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse;
-export enum GenericStatus {
- Accepted = 'Accepted',
- Rejected = 'Rejected',
-}
-
-export interface GenericResponse extends JsonObject {
- status: GenericStatus;
-}
-
-export enum RegistrationStatusEnumType {
- ACCEPTED = 'Accepted',
- PENDING = 'Pending',
- REJECTED = 'Rejected',
-}
-
export const AvailabilityStatus = {
...OCPP16AvailabilityStatus,
} as const;
export type ReservationStatus = OCPP16ReservationStatus;
export const ReservationStatus = {
...OCPP16ReservationStatus,
-};
+} as const;
export type CancelReservationStatus = GenericStatus;
export const CancelReservationStatus = {
...GenericStatus,
-};
+} as const;
export type CancelReservationResponse = GenericResponse;