closes #1034
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
import chalk from 'chalk'
import { satisfies } from 'semver'
import chalk from 'chalk'
import { satisfies } from 'semver'
-import packageJson from './package.json' assert { type: 'json' }
import { version, exit } from 'node:process'
import { version, exit } from 'node:process'
+import { readFileSync } from 'node:fs'
+
+const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'))
/**
* Check if the current node version match the required engines version.
/**
* Check if the current node version match the required engines version.
"pnpm": ">=9.0.0"
},
"volta": {
"pnpm": ">=9.0.0"
},
"volta": {
"pnpm": "9.0.6"
},
"packageManager": "pnpm@9.0.6",
"pnpm": "9.0.6"
},
"packageManager": "pnpm@9.0.6",
}
public get wsConnectionUrl (): URL {
}
public get wsConnectionUrl (): URL {
+ const wsConnectionBaseUrlStr = `${
+ this.stationInfo?.supervisionUrlOcppConfiguration === true &&
+ isNotEmptyString(this.stationInfo.supervisionUrlOcppKey) &&
+ isNotEmptyString(getConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey)?.value)
+ ? getConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey)?.value
+ : this.configuredSupervisionUrl.href
+ }`
- `${
- this.stationInfo?.supervisionUrlOcppConfiguration === true &&
- isNotEmptyString(this.stationInfo.supervisionUrlOcppKey) &&
- isNotEmptyString(getConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey)?.value)
- ? getConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey)?.value
- : this.configuredSupervisionUrl.href
- }/${this.stationInfo?.chargingStationId}`
+ `${wsConnectionBaseUrlStr}${!wsConnectionBaseUrlStr.endsWith('/') ? '/' : ''}${this.stationInfo?.chargingStationId}`
"pnpm": ">=9.0.0"
},
"volta": {
"pnpm": ">=9.0.0"
},
"volta": {
"pnpm": "9.0.6"
},
"packageManager": "pnpm@9.0.6",
"pnpm": "9.0.6"
},
"packageManager": "pnpm@9.0.6",