Commit | Line | Data |
---|---|---|
edd13439 | 1 | // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved. |
953d6b02 | 2 | |
130783a7 JB |
3 | import path from 'node:path'; |
4 | import { fileURLToPath } from 'node:url'; | |
5 | ||
6 | import type { JSONSchemaType } from 'ajv'; | |
7 | ||
268a74bb | 8 | import { type JsonType, OCPPVersion } from '../../../types'; |
953d6b02 JB |
9 | import { OCPPServiceUtils } from '../OCPPServiceUtils'; |
10 | ||
130783a7 | 11 | export 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 | } |