tsconfigRootDir: import.meta.dirname,
},
},
+ rules: {
+ '@typescript-eslint/consistent-type-imports': [
+ 'error',
+ { fixStyle: 'separate-type-imports', prefer: 'type-imports' },
+ ],
+ },
},
{
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
import { secondsToMilliseconds } from 'date-fns'
+import type { OCPP16IncomingRequestCommand } from '../../../types/index.js'
+
import {
addConfigurationKey,
type ChargingStation,
type OCPP16AuthorizeResponse,
type OCPP16BootNotificationResponse,
OCPP16ChargePointStatus,
- OCPP16IncomingRequestCommand,
type OCPP16MeterValue,
type OCPP16MeterValuesRequest,
type OCPP16MeterValuesResponse,
import type { ValidateFunction } from 'ajv'
+import type { OCPP20IncomingRequestCommand } from '../../../types/index.js'
+
import { addConfigurationKey, type ChargingStation } from '../../../charging-station/index.js'
import {
ChargingStationEvents,
type OCPP20BootNotificationResponse,
type OCPP20FirmwareStatusNotificationResponse,
type OCPP20HeartbeatResponse,
- OCPP20IncomingRequestCommand,
type OCPP20LogStatusNotificationResponse,
type OCPP20MeterValuesResponse,
type OCPP20NotifyCustomerInformationResponse,
+import type { RequestStartStopStatusEnumType } from '../../../../types/index.js'
import type { ChargingStation } from '../../../index.js'
import type { OCPPAuthAdapter } from '../interfaces/OCPPAuthService.js'
import type {
import { OCPP20ServiceUtils } from '../../2.0/OCPP20ServiceUtils.js'
import { OCPP20VariableManager } from '../../2.0/OCPP20VariableManager.js'
-import {
- GetVariableStatusEnumType,
- type OCPP20IdTokenType,
- RequestStartStopStatusEnumType,
-} from '../../../../types/index.js'
+import { GetVariableStatusEnumType, type OCPP20IdTokenType } from '../../../../types/index.js'
import {
type AdditionalInfoType,
OCPP20AuthorizationStatusEnumType,
import type { OCPP16AuthAdapter } from '../adapters/OCPP16AuthAdapter.js'
import type { OCPP20AuthAdapter } from '../adapters/OCPP20AuthAdapter.js'
+import type { LocalAuthStrategy } from '../strategies/LocalAuthStrategy.js'
import { OCPPError } from '../../../../exception/OCPPError.js'
import { ErrorType } from '../../../../types/index.js'
type AuthStrategy,
type OCPPAuthService,
} from '../interfaces/OCPPAuthService.js'
-import { LocalAuthStrategy } from '../strategies/LocalAuthStrategy.js'
import {
type AuthConfiguration,
AuthContext,
+import type { OCPPVersion } from '../../../../types/ocpp/OCPPVersion.js'
import type {
AuthCache,
AuthStrategy,
} from '../interfaces/OCPPAuthService.js'
import type { AuthConfiguration, AuthorizationResult, AuthRequest } from '../types/AuthTypes.js'
-import { OCPPVersion } from '../../../../types/ocpp/OCPPVersion.js'
import { ensureError, getErrorMessage, logger } from '../../../../utils/index.js'
import {
AuthenticationError,
import type { JsonObject } from '../../../../types/JsonType.js'
+import type { OCPPVersion } from '../../../../types/ocpp/OCPPVersion.js'
import { OCPP16AuthorizationStatus } from '../../../../types/ocpp/1.6/Transaction.js'
import {
OCPP20IdTokenEnumType,
RequestStartStopStatusEnumType,
} from '../../../../types/ocpp/2.0/Transaction.js'
-import { OCPPVersion } from '../../../../types/ocpp/OCPPVersion.js'
/**
* Authentication context for strategy selection
-import type { AuthorizationResult, AuthRequest, UnifiedIdentifier } from '../types/AuthTypes.js'
+import type { AuthContext, AuthenticationMethod, AuthorizationResult, AuthRequest, UnifiedIdentifier } from '../types/AuthTypes.js'
-import { AuthContext, AuthenticationMethod, AuthorizationStatus } from '../types/AuthTypes.js'
+import { AuthorizationStatus } from '../types/AuthTypes.js'
/**
* Compute remaining TTL in seconds from an expiry date.
* @description Unit tests for OCPP 1.6 RemoteStartTransaction incoming request handler (§5.11)
*/
+import type { mock } from 'node:test'
+
import assert from 'node:assert/strict'
-import { afterEach, beforeEach, describe, it, mock } from 'node:test'
+import { afterEach, beforeEach, describe, it } from 'node:test'
+import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js'
import type { RemoteStartTransactionRequest } from '../../../../src/types/index.js'
import { OCPP16IncomingRequestService } from '../../../../src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.js'
await describe('REMOTE_START_TRANSACTION event listener', async () => {
let incomingRequestService: OCPP16IncomingRequestService
let requestHandlerMock: ReturnType<typeof mock.fn>
- let listenerStation: import('../../../../src/charging-station/ChargingStation.js').ChargingStation
+ let listenerStation: ChargingStation
beforeEach(() => {
;({ requestHandlerMock, station: listenerStation } = createOCPP16ListenerStation(
+import type { mock } from 'node:test'
+
/**
* @file Tests for OCPP20IncomingRequestService RequestStartTransaction
* @description Unit tests for OCPP 2.0 RequestStartTransaction command handling (F01/F02)
*/
import assert from 'node:assert/strict'
-import { afterEach, beforeEach, describe, it, mock } from 'node:test'
+import { afterEach, beforeEach, describe, it } from 'node:test'
import type { ChargingStation } from '../../../../src/charging-station/index.js'
import type {
* @description Unit tests for OCPP 2.0 RequestStopTransaction command handling (F03)
*/
+import type { mock } from 'node:test'
+
import assert from 'node:assert/strict'
-import { afterEach, beforeEach, describe, it, mock } from 'node:test'
+import { afterEach, beforeEach, describe, it } from 'node:test'
import type { ChargingStation } from '../../../../src/charging-station/index.js'
import type {
import type {
ChargingStationData,
+ ProcedureName,
ProtocolRequest,
ProtocolResponse,
+ ProtocolVersion,
RequestPayload,
+
UIServerConfiguration,
- UUIDv4,
+ UUIDv4
} from '../../../src/types/index.js'
import { UIWebSocketServer } from '../../../src/charging-station/ui-server/UIWebSocketServer.js'
ApplicationProtocol,
ApplicationProtocolVersion,
AuthenticationType,
- ProcedureName,
- ProtocolVersion,
ResponseStatus,
} from '../../../src/types/index.js'
import { MockWebSocket } from '../mocks/MockWebSocket.js'
+import type { ChargingStation } from '../../src/charging-station/ChargingStation.js'
import type {
AuthConfiguration,
AuthorizationResult,
UnifiedIdentifier,
} from '../../src/charging-station/ocpp/auth/types/AuthTypes.js'
-import { ChargingStation } from '../../src/charging-station/ChargingStation.js'
import { OCPPAuthServiceImpl } from '../../src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.js'
import {
AuthContext,