From: Jérôme Benoit Date: Tue, 31 Mar 2026 20:20:00 +0000 (+0200) Subject: refactor: merge duplicate same-kind imports from identical sources X-Git-Tag: ocpp-server@v4.1.0~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bb603d61ed4c156b4d637da1d1f2c20ee8895d13;p=e-mobility-charging-stations-simulator.git refactor: merge duplicate same-kind imports from identical sources --- diff --git a/src/charging-station/ocpp/OCPPIncomingRequestService.ts b/src/charging-station/ocpp/OCPPIncomingRequestService.ts index ff9f3c9b..45c8f6b7 100644 --- a/src/charging-station/ocpp/OCPPIncomingRequestService.ts +++ b/src/charging-station/ocpp/OCPPIncomingRequestService.ts @@ -1,5 +1,4 @@ -import type { ValidateFunction } from 'ajv' -import type _Ajv from 'ajv' +import type { default as _Ajv, ValidateFunction } from 'ajv' import { EventEmitter } from 'node:events' diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 49a48307..8ddf85e5 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -1,5 +1,4 @@ -import type { ValidateFunction } from 'ajv' -import type _Ajv from 'ajv' +import type { default as _Ajv, ValidateFunction } from 'ajv' import type { ChargingStation } from '../../charging-station/index.js' import type { OCPPResponseService } from './OCPPResponseService.js' diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index ad9674f2..44f15090 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -1,5 +1,4 @@ -import type { ValidateFunction } from 'ajv' -import type _Ajv from 'ajv' +import type { default as _Ajv, ValidateFunction } from 'ajv' import type { ChargingStation } from '../../charging-station/index.js' diff --git a/src/charging-station/ocpp/auth/interfaces/OCPPAuthService.ts b/src/charging-station/ocpp/auth/interfaces/OCPPAuthService.ts index 13edf9b1..6345ea37 100644 --- a/src/charging-station/ocpp/auth/interfaces/OCPPAuthService.ts +++ b/src/charging-station/ocpp/auth/interfaces/OCPPAuthService.ts @@ -2,10 +2,11 @@ import type { JsonObject, OCPPVersion } from '../../../../types/index.js' import type { AuthConfiguration, AuthorizationResult, + AuthorizationStatus, AuthRequest, Identifier, + IdentifierType, } from '../types/AuthTypes.js' -import type { AuthorizationStatus, IdentifierType } from '../types/AuthTypes.js' /** * Authorization cache interface diff --git a/src/charging-station/ocpp/auth/types/AuthTypes.ts b/src/charging-station/ocpp/auth/types/AuthTypes.ts index 1e1c1878..0bd2bf17 100644 --- a/src/charging-station/ocpp/auth/types/AuthTypes.ts +++ b/src/charging-station/ocpp/auth/types/AuthTypes.ts @@ -1,5 +1,8 @@ -import type { JsonObject, OCPPVersion } from '../../../../types/index.js' -import type { OCPP20MessageFormatEnumType } from '../../../../types/index.js' +import type { + JsonObject, + OCPP20MessageFormatEnumType, + OCPPVersion, +} from '../../../../types/index.js' import { OCPP16AuthorizationStatus, diff --git a/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts b/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts index 0c6fe70b..d171b36c 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts @@ -7,8 +7,7 @@ */ import assert from 'node:assert/strict' -import { mock } from 'node:test' -import { afterEach, beforeEach, describe, it } from 'node:test' +import { afterEach, beforeEach, describe, it, mock } from 'node:test' import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { TestableOCPP16IncomingRequestService } from '../../../../src/charging-station/ocpp/1.6/__testable__/index.js' diff --git a/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts index 541bf628..ae433626 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts @@ -11,8 +11,8 @@ import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { OCPP20TransactionEventRequest, OCPP20TransactionEventResponse, + UUIDv4, } from '../../../../src/types/index.js' -import type { UUIDv4 } from '../../../../src/types/index.js' import { OCPP20ResponseService } from '../../../../src/charging-station/ocpp/2.0/OCPP20ResponseService.js' import { OCPP20ServiceUtils } from '../../../../src/charging-station/ocpp/2.0/OCPP20ServiceUtils.js' diff --git a/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts b/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts index 09e91504..d4ab7289 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts @@ -14,9 +14,9 @@ import type { GetCertificateIdUseEnumType, JsonType, OCPP20IdTokenType, + OCPP20RequestCommand, OCSPRequestDataType, } from '../../../../src/types/index.js' -import type { OCPP20RequestCommand } from '../../../../src/types/index.js' import { buildConfigKey } from '../../../../src/charging-station/index.js' import { OCPP20RequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20RequestService.js' diff --git a/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts b/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts index 88c6ab03..e42ae662 100644 --- a/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts +++ b/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts @@ -18,9 +18,9 @@ import { import { OCPP20AuthorizationStatusEnumType, OCPP20IdTokenEnumType, + OCPPVersion, RequestStartStopStatusEnumType, } from '../../../../../src/types/index.js' -import { OCPPVersion } from '../../../../../src/types/index.js' import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js' import { createMockAuthorizationResult, createMockIdentifier } from '../helpers/MockFactories.js' diff --git a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts index b77b5d92..7cb48975 100644 --- a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts +++ b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts @@ -23,8 +23,11 @@ import { type Identifier, IdentifierType, } from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js' -import { OCPPVersion } from '../../../../../src/types/index.js' -import { OCPP20IdTokenEnumType, type OCPP20IdTokenType } from '../../../../../src/types/index.js' +import { + OCPP20IdTokenEnumType, + type OCPP20IdTokenType, + OCPPVersion, +} from '../../../../../src/types/index.js' /** * Factory functions for creating test mocks and fixtures