refactor(simulator): switch to named exports
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 2.0 / OCPP20ServiceUtils.ts
CommitLineData
edd13439 1// Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
953d6b02 2
130783a7
JB
3import path from 'node:path';
4import { fileURLToPath } from 'node:url';
5
6import type { JSONSchemaType } from 'ajv';
7
268a74bb 8import { type JsonType, OCPPVersion } from '../../../types';
953d6b02
JB
9import { OCPPServiceUtils } from '../OCPPServiceUtils';
10
130783a7 11export class OCPP20ServiceUtils extends OCPPServiceUtils {
1b271a54
JB
12 public static parseJsonSchemaFile<T extends JsonType>(
13 relativePath: string,
14 moduleName?: string,
15 methodName?: string
16 ): JSONSchemaType<T> {
7164966d
JB
17 return super.parseJsonSchemaFile<T>(
18 path.resolve(path.dirname(fileURLToPath(import.meta.url)), relativePath),
1b271a54
JB
19 OCPPVersion.VERSION_20,
20 moduleName,
21 methodName
7164966d 22 );
130783a7
JB
23 }
24}