@citrineos/configuration
Version:
The configuration module for OCPP v2.0.1. This module is not intended to be used directly, but rather as a dependency for other modules.
58 lines (57 loc) • 3.47 kB
TypeScript
import type { IBootRepository } from '@citrineos/data';
import { Boot } from '@citrineos/data';
import type { BootConfig, ICache, IMessageConfirmation, SystemConfig } from '@citrineos/base';
import { OCPP1_6, OCPP2_0_1 } from '@citrineos/base';
import type { ILogObj } from 'tslog';
import { Logger } from 'tslog';
type Configuration = SystemConfig['modules']['configuration'];
export declare class BootNotificationService {
protected _bootRepository: IBootRepository;
protected _cache: ICache;
protected _logger: Logger<ILogObj>;
protected _config: Configuration;
constructor(bootRepository: IBootRepository, cache: ICache, config: Configuration, logger?: Logger<ILogObj>);
determineBootStatus(bootConfig: Boot | undefined): OCPP2_0_1.RegistrationStatusEnumType;
createBootNotificationResponse(tenantId: number, stationId: string): Promise<OCPP2_0_1.BootNotificationResponse>;
updateBootConfig(bootNotificationResponse: OCPP2_0_1.BootNotificationResponse, tenantId: number, stationId: string): Promise<Boot>;
/**
* Determines whether to blacklist or whitelist charger actions based on its boot status.
*
* If the new boot is accepted and the charger actions were previously blacklisted, then whitelist the charger actions.
* If the new boot is not accepted and charger actions were previously whitelisted, then blacklist the charger actions.
*
* @param stationId
* @param cachedBootStatus
* @param bootNotificationResponseStatus
*/
cacheChargerActionsPermissions(stationId: string, cachedBootStatus: OCPP2_0_1.RegistrationStatusEnumType | null, bootNotificationResponseStatus: OCPP2_0_1.RegistrationStatusEnumType): Promise<void>;
createGetBaseReportRequest(stationId: string, maxCachingSeconds: number): Promise<OCPP2_0_1.GetBaseReportRequest>;
/**
* Based on the GetBaseReportMessageConfirmation, checks the cache to ensure GetBaseReport truly succeeded.
* If GetBaseReport did not succeed, this method will throw. Otherwise, it will finish without throwing.
*
* @param stationId
* @param requestId
* @param getBaseReportMessageConfirmation
* @param maxCachingSeconds
*/
confirmGetBaseReportSuccess(stationId: string, requestId: string, getBaseReportMessageConfirmation: IMessageConfirmation, maxCachingSeconds: number): Promise<void>;
/**
* Methods for OCPP 1.6
*/
determineOcpp16BootStatus(bootConfig: BootConfig | undefined): OCPP1_6.BootNotificationResponseStatus;
createOcpp16BootNotificationResponse(tenantId: number, stationId: string): Promise<OCPP1_6.BootNotificationResponse>;
/**
* Determines whether to blacklist or whitelist charger actions based on its boot status.
*
* If the new boot is accepted and the charger actions were previously blacklisted, then whitelist the charger actions.
* If the new boot is not accepted and charger actions were previously whitelisted, then blacklist the charger actions.
*
* @param stationId
* @param cachedBootStatus
* @param bootNotificationResponseStatus
*/
cacheOcpp16ChargerActionsPermissions(stationId: string, cachedBootStatus: OCPP1_6.BootNotificationResponseStatus | null, bootNotificationResponseStatus: OCPP1_6.BootNotificationResponseStatus): Promise<void>;
updateOcpp16BootConfig(response: OCPP1_6.BootNotificationResponse, tenantId: number, stationId: string): Promise<Boot>;
}
export {};