* and sorted by priorities
* @param chargingStation - Charging station
* @param connectorId - Connector id
- * @returns connector charging profiles array
+ * @returns Connector charging profiles array
*/
export const getConnectorChargingProfiles = (
chargingStation: ChargingStation,
/**
* Get the charging profiles limit for a connector
* Charging profiles shall already be sorted by priorities
- * @param chargingStation -
- * @param connectorId -
- * @param chargingProfiles -
+ * @param chargingStation - The charging station instance
+ * @param connectorId - The connector identifier
+ * @param chargingProfiles - Array of charging profiles
* @returns ChargingProfilesLimit
*/
const getChargingProfilesLimit = (
/**
* Adjust recurring charging profile startSchedule to the current recurrency time interval if needed
- * @param chargingProfile -
- * @param currentDate -
- * @param logPrefix -
- * @returns boolean
+ * @param chargingProfile - The charging profile to adjust
+ * @param currentDate - The current date/time
+ * @param logPrefix - Prefix for logging messages
+ * @returns Whether the charging profile is active at the given date
*/
const prepareRecurringChargingProfile = (
chargingProfile: ChargingProfile,
/**
* Gets one idtag from the cache given the distribution
* Must be called after checking the cache is not an empty array
- * @param distribution -
- * @param chargingStation -
- * @param connectorId -
- * @returns string
+ * @param distribution - The distribution strategy for selecting an idtag
+ * @param chargingStation - The charging station instance
+ * @param connectorId - The connector identifier
+ * @returns Selected idtag string
*/
public getIdTag (
distribution: IdTagDistribution,
/**
* Gets all idtags from the cache
* Must be called after checking the cache is not an empty array
- * @param file -
- * @returns string[] | undefined
+ * @param file - The idtags file path
+ * @returns Array of idtag strings or undefined if not cached
*/
public getIdTags (file: string): string[] | undefined {
if (!this.hasIdTagsCache(file)) {
* 2. Case-insensitive composite key (lookup convenience): `${component}[.<instance>].${variable}` all lower case
* - Built with buildCaseInsensitiveCompositeKey().
* Rationale: Maintain original case for canonical metadata storage while offering tolerant lookups.
- * @param component Component name.
- * @param variable Variable name.
- * @param instance Optional instance qualifier.
+ * @param component - Component name.
+ * @param variable - Variable name.
+ * @param instance - Optional instance qualifier.
* @returns Primary registry key string.
*/
function buildRegistryKey (component: string, variable: string, instance?: string): string {
/**
* Build composite lookup key (lower-cased) including optional instance.
* Format: `component[.instance].variable` all lower case.
- * @param component Component name.
- * @param instance Optional instance qualifier.
- * @param variable Variable name.
+ * @param component - Component name.
+ * @param instance - Optional instance qualifier.
+ * @param variable - Variable name.
* @returns Lower-case composite key for lookup.
*/
export function buildCaseInsensitiveCompositeKey (
/**
* Apply optional metadata post-processing to a resolved variable value.
- * @param chargingStation Charging station context.
- * @param variableMetadata Variable metadata entry.
- * @param value Resolved raw value.
+ * @param chargingStation - Charging station context.
+ * @param variableMetadata - Variable metadata entry.
+ * @param value - Resolved raw value.
* @returns Post-processed value (or original when no postProcess defined).
*/
export function applyPostProcess (
/**
* Enforce reporting/value size limit on a string.
- * @param value Incoming value string.
- * @param sizeLimitRaw Raw size limit value (string form).
+ * @param value - Incoming value string.
+ * @param sizeLimitRaw - Raw size limit value (string form).
* @returns Possibly truncated value respecting size limit.
*/
export function enforceReportingValueSize (value: string, sizeLimitRaw: string): string {
/**
* Retrieve variable metadata with case-insensitive fallback.
- * @param component Component name.
- * @param variable Variable name.
- * @param instance Optional instance qualifier.
+ * @param component - Component name.
+ * @param variable - Variable name.
+ * @param instance - Optional instance qualifier.
* @returns Matching variable metadata or undefined.
*/
export function getVariableMetadata (
/**
* Check if variable metadata is persistent.
- * @param variableMetadata Variable metadata entry.
+ * @param variableMetadata - Variable metadata entry.
* @returns True when persistence is Persistent.
*/
export function isPersistent (variableMetadata: VariableMetadata): boolean {
/**
* Check if variable metadata is read-only.
- * @param variableMetadata Variable metadata entry.
+ * @param variableMetadata - Variable metadata entry.
* @returns True when mutability is ReadOnly.
*/
export function isReadOnly (variableMetadata: VariableMetadata): boolean {
/**
* Check if variable metadata is write-only.
- * @param variableMetadata Variable metadata entry.
+ * @param variableMetadata - Variable metadata entry.
* @returns True when mutability is WriteOnly.
*/
export function isWriteOnly (variableMetadata: VariableMetadata): boolean {
/**
* Resolve variable value using dynamicValueResolver if present else defaultValue.
- * @param chargingStation Charging station context.
- * @param variableMetadata Variable metadata entry.
+ * @param chargingStation - Charging station context.
+ * @param variableMetadata - Variable metadata entry.
* @returns Resolved value string (empty when no default).
*/
export function resolveValue (
/**
* Validate raw value against variable metadata constraints.
* Performs length, datatype specific and enumeration checks.
- * @param variableMetadata Variable metadata entry.
- * @param rawValue Raw value string to validate.
+ * @param variableMetadata - Variable metadata entry.
+ * @param rawValue - Raw value string to validate.
* @returns Validation result with ok flag and optional reason/info.
*/
export function validateValue (
/**
* Validate URL using generic parsing (any scheme accepted).
- * @param value Raw URL string.
+ * @param value - Raw URL string.
* @returns Validation result with ok flag and optional reason/info.
*/
function validateGenericUrl (value: string): {
/**
* Validate URL scheme against an allowed list after generic format check.
- * @param value Raw URL string.
- * @param allowedSchemes Allowed protocol schemes (with trailing colon).
+ * @param value - Raw URL string.
+ * @param allowedSchemes - Allowed protocol schemes (with trailing colon).
* @returns Validation result with ok flag and optional reason/info.
*/
function validateUrlScheme (
return await new Promise<ResponseType>((resolve, reject: (reason?: unknown) => void) => {
/**
* Function that will receive the request's response
- * @param payload -
- * @param requestPayload -
+ * @param payload - The response payload
+ * @param requestPayload - The original request payload
*/
const responseCallback = (payload: JsonType, requestPayload: JsonType): void => {
if (chargingStation.stationInfo?.enableStatistics === true) {
/**
* Function that will receive the request's error response
- * @param ocppError -
- * @param requestStatistic -
+ * @param ocppError - The OCPP error response
+ * @param requestStatistic - Whether to record request statistics
*/
const errorCallback = (ocppError: OCPPError, requestStatistic = true): void => {
if (requestStatistic && chargingStation.stationInfo?.enableStatistics === true) {
/**
* Builds a sampled value object according to the specified OCPP version.
- * @param ocppVersion The OCPP version to use for formatting the sampled value
- * @param sampledValueTemplate Template containing measurement configuration and metadata
- * @param value The measured numeric value to be included in the sampled value
- * @param context Optional context specifying when the measurement was taken (e.g., Sample.Periodic)
- * @param phase Optional phase information for multi-phase electrical measurements
+ * @param ocppVersion - The OCPP version to use for formatting the sampled value
+ * @param sampledValueTemplate - Template containing measurement configuration and metadata
+ * @param value - The measured numeric value to be included in the sampled value
+ * @param context - Optional context specifying when the measurement was taken (e.g., Sample.Periodic)
+ * @param phase - Optional phase information for multi-phase electrical measurements
* @returns A sampled value object formatted according to the specified OCPP version
*/
function buildSampledValue (
/**
* Creates a Map of compiled OCPP payload validators from configurations.
* Reduces code duplication across OCPP services.
- * @param configs Array of tuples containing command and validator configuration
- * @param options Factory options including OCPP version, schema directory, etc.
- * @param options.ocppVersion The OCPP version for schema validation
- * @param options.schemaDir Directory path containing JSON schemas
- * @param options.moduleName Name of the module for logging
- * @param options.methodName Name of the method for logging
- * @param ajvInstance Configured Ajv instance for validation
+ * @param configs - Array of tuples containing command and validator configuration
+ * @param options - Factory options including OCPP version, schema directory, etc.
+ * @param options.ocppVersion - The OCPP version for schema validation
+ * @param options.schemaDir - Directory path containing JSON schemas
+ * @param options.moduleName - Name of the module for logging
+ * @param options.methodName - Name of the method for logging
+ * @param ajvInstance - Configured Ajv instance for validation
* @returns Map of commands to their compiled validation functions
*/
public static createPayloadValidatorMap<Command extends JsonType>(
/**
* Configuration for a single payload validator.
- * @param schemaPath Path to the JSON schema file
+ * @param schemaPath - Path to the JSON schema file
* @returns Configuration object for payload validator creation
*/
public static readonly PayloadValidatorConfig = (schemaPath: string) =>
/**
* Options for payload validator creation.
- * @param ocppVersion The OCPP version
- * @param schemaDir Directory containing JSON schemas
- * @param moduleName Name of the OCPP module
- * @param methodName Name of the method/command
+ * @param ocppVersion - The OCPP version
+ * @param schemaDir - Directory containing JSON schemas
+ * @param moduleName - Name of the OCPP module
+ * @param methodName - Name of the method/command
* @returns Options object for payload validator creation
*/
public static readonly PayloadValidatorOptions = (
/**
* Parses and loads a JSON schema file for OCPP payload validation.
* Handles file reading and JSON parsing for schema validation.
- * @param relativePath Path to the schema file relative to the OCPP utils directory
- * @param ocppVersion The OCPP version for error logging context
- * @param moduleName Optional module name for error logging
- * @param methodName Optional method name for error logging
+ * @param relativePath - Path to the schema file relative to the OCPP utils directory
+ * @param ocppVersion - The OCPP version for error logging context
+ * @param moduleName - Optional module name for error logging
+ * @param methodName - Optional method name for error logging
* @returns Parsed JSON schema object
* @throws {NodeJS.ErrnoException} If the schema file cannot be read or parsed
*/
/**
* `WorkerAbstract` constructor.
- * @param workerScript -
- * @param workerOptions -
+ * @param workerScript - Path to the worker script file
+ * @param workerOptions - Worker configuration options
*/
constructor (workerScript: string | undefined, workerOptions: WorkerOptions) {
if (workerScript == null) {
/**
* Adds a task element to the worker pool/set.
- * @param elementData -
+ * @param elementData - The element data to process
*/
public abstract addElement (elementData: D): Promise<R>
/**
/**
* Creates a new `WorkerDynamicPool`.
- * @param workerScript -
- * @param workerOptions -
+ * @param workerScript - Path to the worker script file
+ * @param workerOptions - Worker pool configuration options
*/
constructor (workerScript: string, workerOptions: WorkerOptions) {
super(workerScript, workerOptions)
/**
* Creates a new `WorkerFixedPool`.
- * @param workerScript -
- * @param workerOptions -
+ * @param workerScript - Path to the worker script file
+ * @param workerOptions - Worker pool configuration options
*/
constructor (workerScript: string, workerOptions: WorkerOptions) {
super(workerScript, workerOptions)
/**
* Creates a new `WorkerSet`.
- * @param workerScript -
- * @param workerOptions -
+ * @param workerScript - Path to the worker script file
+ * @param workerOptions - Worker set configuration options
*/
constructor (workerScript: string, workerOptions: WorkerOptions) {
super(workerScript, workerOptions)