-import type { WebSocketLike } from './types.js'
import type { WebSocketReadyState } from './types.js'
+import { type WebSocketLike } from './types.js'
+
interface BrowserWebSocket {
close(code?: number, reason?: string): void
set onclose(handler: ((event: { code: number; reason: string }) => void) | null)
export type Configuration = z.infer<typeof configurationSchema>
export type UIServerConfig = z.infer<typeof uiServerConfigSchema>
-export type { UIServerConfig as UIServerConfigurationSection }
export * from './client/WebSocketClient.js'
export * from './config/schema.js'
export * from './constants.js'
+export * from './types/ChargingStationType.js'
+export * from './types/ConfigurationType.js'
export * from './types/JsonType.js'
export * from './types/UIProtocol.js'
export * from './types/UUID.js'
-import type { JsonObject } from 'ui-common'
+import type { JsonObject } from './JsonType.js'
export enum AmpereUnits {
AMPERE = 'A',
supervisionUrl: string
wsState?:
| typeof WebSocket.CLOSED
- | typeof WebSocket.CLOSING
- | typeof WebSocket.CONNECTING
- | typeof WebSocket.OPEN
+
}
export interface ChargingStationInfo extends JsonObject {
-import type { AuthenticationType, ProtocolVersion } from 'ui-common'
-
-import type { Protocol } from './UIProtocol'
+import type { AuthenticationType, ProtocolVersion } from './UIProtocol.js'
+import type { Protocol } from './UIProtocol.js'
export interface ConfigurationData {
theme?: string
import type { JsonObject } from './JsonType.js'
import type { UUIDv4 } from './UUID.js'
+export enum ApplicationProtocol {
+ WS = 'ws',
+ WSS = 'wss',
+}
+
export enum AuthenticationType {
PROTOCOL_BASIC_AUTH = 'protocol-basic-auth',
}
UNLOCK_CONNECTOR = 'unlockConnector',
}
+export enum Protocol {
+ UI = 'ui',
+}
+
export enum ProtocolVersion {
'0.0.1' = '0.0.1',
}
responsesFailed?: BroadcastChannelResponsePayload[]
status: ResponseStatus
}
+
+export interface SimulatorState {
+ started: boolean
+ templateStatistics: Record<string, TemplateStatistics>
+ version: string
+}
+
+export interface TemplateStatistics {
+ added: number
+ configured: number
+ indexes: number[]
+ started: number
+}
&& chmod +x /run.sh \
&& chmod +x /autoconfig.sh
+EXPOSE 3030
ENTRYPOINT ["/bin/sh", "-c", "/autoconfig.sh && /run.sh"]
</template>
<script setup lang="ts">
+import { type OCPPVersion } from 'ui-common'
import { computed, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useToast } from 'vue-toast-notification'
import Button from '@/components/buttons/Button.vue'
import { convertToInt, resetToggleButtonState, ROUTE_NAMES, useUIClient } from '@/composables'
-import { type OCPPVersion } from '@/types/ChargingStationType'
const props = defineProps<{
chargingStationId: string
</template>
<script setup lang="ts">
-import { useToast } from 'vue-toast-notification'
+import type { ConnectorStatus, OCPPVersion, Status } from 'ui-common'
-import type { ConnectorStatus, OCPPVersion, Status } from '@/types/ChargingStationType'
+import { useToast } from 'vue-toast-notification'
import Button from '@/components/buttons/Button.vue'
import StateButton from '@/components/buttons/StateButton.vue'
</template>
<script setup lang="ts">
+import type { ChargingStationData, ConnectorEntry, Status } from 'ui-common'
+
import { computed } from 'vue'
import { useToast } from 'vue-toast-notification'
-import type { ChargingStationData, ConnectorEntry, Status } from '@/types/ChargingStationType'
-
import Button from '@/components/buttons/Button.vue'
import StateButton from '@/components/buttons/StateButton.vue'
import ToggleButton from '@/components/buttons/ToggleButton.vue'
</template>
<script setup lang="ts">
-import type { ChargingStationData } from '@/types/ChargingStationType'
+import type { ChargingStationData } from 'ui-common'
import CSData from '@/components/charging-stations/CSData.vue'
import {
+ type ChargingStationOptions,
createBrowserWsAdapter,
+ OCPP20IdTokenEnumType,
+ OCPP20TransactionEventEnumType,
+ type OCPP20TransactionEventRequest,
+ OCPPVersion,
ProcedureName,
type RequestPayload,
type ResponsePayload,
ResponseStatus,
ServerNotification,
+ type UIServerConfigurationSection,
WebSocketClient,
type WebSocketFactory,
} from 'ui-common'
import { useToast } from 'vue-toast-notification'
-import type { UIServerConfigurationSection } from '@/types/ConfigurationType'
-
-import {
- type ChargingStationOptions,
- OCPP20IdTokenEnumType,
- OCPP20TransactionEventEnumType,
- type OCPP20TransactionEventRequest,
- OCPPVersion,
-} from '@/types/ChargingStationType'
-
export class UIClient {
private static instance: null | UIClient = null
private abortConnection: () => void
-import type { UUIDv4 } from 'ui-common'
+import type { ChargingStationData, ConfigurationData, UUIDv4 } from 'ui-common'
import type { InjectionKey, Ref } from 'vue'
import { inject } from 'vue'
import { useToast } from 'vue-toast-notification'
-import type { ChargingStationData } from '@/types/ChargingStationType'
-import type { ConfigurationData } from '@/types/ConfigurationType'
-
import {
EMPTY_VALUE_PLACEHOLDER,
SHARED_TOGGLE_BUTTON_KEY_PREFIX,
+import type {
+ ChargingStationData,
+ ConfigurationData,
+ UIServerConfigurationSection,
+} from 'ui-common'
+
import { type App as AppType, type Component, createApp, ref } from 'vue'
import ToastPlugin from 'vue-toast-notification'
-import type { ChargingStationData } from '@/types/ChargingStationType'
-import type { ConfigurationData, UIServerConfigurationSection } from '@/types/ConfigurationType'
-
import App from '@/App.vue'
import {
chargingStationsKey,
+++ /dev/null
-export enum ApplicationProtocol {
- WS = 'ws',
- WSS = 'wss',
-}
-
-export enum Protocol {
- UI = 'ui',
-}
-
-export interface SimulatorState {
- started: boolean
- templateStatistics: Record<string, TemplateStatistics>
- version: string
-}
-
-interface TemplateStatistics {
- added: number
- configured: number
- indexes: number[]
- started: number
-}
</template>
<script setup lang="ts">
-import type { ResponsePayload, UUIDv4 } from 'ui-common'
+import type { ChargingStationData, ResponsePayload, SimulatorState, UIServerConfigurationSection, UUIDv4 } from 'ui-common'
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { useToast } from 'vue-toast-notification'
-import type { ChargingStationData } from '@/types/ChargingStationType'
-import type { UIServerConfigurationSection } from '@/types/ConfigurationType'
-import type { SimulatorState } from '@/types/UIProtocol'
-
import StateButton from '@/components/buttons/StateButton.vue'
import ToggleButton from '@/components/buttons/ToggleButton.vue'
import CSTable from '@/components/charging-stations/CSTable.vue'
* @description Unit tests for connector row display, transaction actions, and ATG controls.
*/
import { flushPromises, mount } from '@vue/test-utils'
+import { OCPP16ChargePointStatus } from 'ui-common'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { UIClient } from '@/composables'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import { EMPTY_VALUE_PLACEHOLDER, useUIClient } from '@/composables'
-import { OCPP16ChargePointStatus } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import { createConnectorStatus, TEST_HASH_ID, TEST_STATION_ID } from './constants'
+import type { ChargingStationData } from 'ui-common'
+
/**
* @file Tests for CSData component
* @description Unit tests for charging station row display, actions, and connector entry generation.
*/
import { flushPromises, mount } from '@vue/test-utils'
+import { OCPPVersion } from 'ui-common'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { UIClient } from '@/composables'
-import type { ChargingStationData } from '@/types/ChargingStationType'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import CSData from '@/components/charging-stations/CSData.vue'
import { EMPTY_VALUE_PLACEHOLDER, useUIClient } from '@/composables'
-import { OCPPVersion } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import {
+import type { ChargingStationData } from 'ui-common'
+
/**
* @file Tests for CSTable component
* @description Unit tests for charging station table column headers and row rendering.
import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
-import type { ChargingStationData } from '@/types/ChargingStationType'
-
import CSTable from '@/components/charging-stations/CSTable.vue'
import { createChargingStationData, createStationInfo } from './constants'
* @description Unit tests for start transaction form — OCPP version branching, authorization flow, and navigation.
*/
import { flushPromises, mount } from '@vue/test-utils'
+import { OCPPVersion } from 'ui-common'
import { describe, expect, it, vi } from 'vitest'
import type { UIClient } from '@/composables'
import StartTransaction from '@/components/actions/StartTransaction.vue'
import { useUIClient } from '@/composables'
-import { OCPPVersion } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import { TEST_HASH_ID, TEST_ID_TAG, TEST_STATION_ID } from './constants'
/* eslint-disable @typescript-eslint/no-non-null-assertion */
-import { AuthenticationType, ProcedureName, ResponseStatus, ServerNotification } from 'ui-common'
/**
* @file Tests for UIClient composable
* @description Unit tests for WebSocket client singleton, connection lifecycle,
* request/response handling, and all simulator/station operations.
*/
+import {
+ AuthenticationType,
+ OCPP20TransactionEventEnumType,
+ OCPPVersion,
+ ProcedureName,
+ ResponseStatus,
+ ServerNotification,
+} from 'ui-common'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { UIClient } from '@/composables'
-import { OCPP20TransactionEventEnumType, OCPPVersion } from '@/types/ChargingStationType'
import { toastMock } from '../setup'
import { createUIServerConfig, TEST_HASH_ID, TEST_ID_TAG } from './constants'
* @description Factory functions (NOT static objects) for ChargingStationData,
* ConnectorStatus, and other test fixtures. Using factories prevents shared state.
*/
-import { ProtocolVersion } from 'ui-common'
-
-import type { UIServerConfigurationSection } from '@/types/ConfigurationType'
-
import {
type ChargingStationData,
type ChargingStationInfo,
OCPP16ChargePointStatus,
OCPP16RegistrationStatus,
OCPPVersion,
-} from '@/types/ChargingStationType'
-import { Protocol } from '@/types/UIProtocol'
+ Protocol,
+ ProtocolVersion,
+ type UIServerConfigurationSection,
+} from 'ui-common'
// ── Shared Test Constants ─────────────────────────────────────────────────────