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