Skip to content

Commit

Permalink
fix: Add types to support VRM manual config
Browse files Browse the repository at this point in the history
  • Loading branch information
mman committed Oct 17, 2024
1 parent 80ace98 commit 5d8ee03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export const ADMIN_API_VRM_LOGIN = `${ADMIN_API}/${API_VRM_LOGIN}`

export type VRMLoginMethod = "credentials" | "token"

export type VRMDeviceType = "discovered" | "configured"

export interface VRMBaseLoginRequest {
method: VRMLoginMethod
}
Expand Down
15 changes: 12 additions & 3 deletions src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,29 @@ export type AppUPNPConfigKey = keyof AppUPNPConfig
export interface AppVRMConfig {
enabled: boolean
enabledPortalIds: string[]
manualPortalIds: AppInstallationConfig[]
hasToken: boolean
}

export type AppVRMConfigKey = keyof AppVRMConfig

export interface AppHostConfig {
export interface AppDeviceConfig {
hostName: string
enabled: boolean
}

export type AppHostConfigKey = keyof AppHostConfig
export type AppDeviceConfigKey = keyof AppDeviceConfig

export interface AppInstallationConfig {
portalId: string
enabled: boolean
}

export type AppInstallationConfigKey = keyof AppInstallationConfig

export interface AppManualConfig {
enabled: boolean
hosts: AppHostConfig[]
hosts: AppDeviceConfig[]
}

export type AppManualConfigKey = keyof AppManualConfig
Expand Down Expand Up @@ -87,6 +95,7 @@ const defaultAppConfigValues: AppConfig = {
vrm: {
enabled: false,
enabledPortalIds: [],
manualPortalIds: [],
hasToken: false,
},
influxdb: {
Expand Down

0 comments on commit 5d8ee03

Please sign in to comment.