@enyo-energy/energy-app-sdk 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -0
- package/dist/cjs/connect-ems-api.cjs +2 -0
- package/dist/cjs/connect-ems-api.d.cts +30 -0
- package/dist/cjs/connect-ems-permission.enum.cjs +7 -0
- package/dist/cjs/connect-ems-permission.enum.d.cts +3 -0
- package/dist/cjs/connect-ems-permission.type.cjs +2 -0
- package/dist/cjs/connect-ems-permission.type.d.cts +1 -0
- package/dist/cjs/connect-package-definition.cjs +14 -0
- package/dist/cjs/connect-package-definition.d.cts +57 -0
- package/dist/cjs/energy-app-appliance-type.enum.cjs +14 -0
- package/dist/cjs/energy-app-appliance-type.enum.d.cts +10 -0
- package/dist/cjs/energy-app-package-configuration.cjs +2 -0
- package/dist/cjs/energy-app-package-configuration.d.cts +30 -0
- package/dist/cjs/energy-app-package-definition.cjs +30 -0
- package/dist/cjs/energy-app-package-definition.d.cts +123 -0
- package/dist/cjs/energy-app-permission.type.cjs +21 -0
- package/dist/cjs/energy-app-permission.type.d.cts +18 -0
- package/dist/cjs/enyo-energy-app-sdk.cjs +12 -0
- package/dist/cjs/enyo-energy-app-sdk.d.cts +67 -0
- package/dist/cjs/hems-one-energy-app-sdk.cjs +12 -0
- package/dist/cjs/hems-one-energy-app-sdk.d.cts +64 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.cjs +388 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.d.cts +59 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.cjs +37 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.d.cts +15 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.cjs +130 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.d.cts +41 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.cjs +49 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.cts +10 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.cjs +348 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.d.cts +56 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.cjs +199 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.d.cts +26 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.cjs +98 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.d.cts +13 -0
- package/dist/cjs/implementations/modbus/interfaces.cjs +29 -0
- package/dist/cjs/implementations/modbus/interfaces.d.cts +202 -0
- package/dist/cjs/implementations/ocpp/ocpp-common.cjs +337 -0
- package/dist/cjs/implementations/ocpp/ocpp-common.d.cts +75 -0
- package/dist/cjs/implementations/ocpp/ocpp16.cjs +51 -0
- package/dist/cjs/implementations/ocpp/ocpp16.d.cts +137 -0
- package/dist/cjs/implementations/ocpp/ocpp201.cjs +84 -0
- package/dist/cjs/implementations/ocpp/ocpp201.d.cts +215 -0
- package/dist/cjs/index.cjs +117 -0
- package/dist/cjs/index.d.cts +56 -0
- package/dist/cjs/mockConnectEmsApi.cjs +167 -0
- package/dist/cjs/mockConnectEmsApi.d.cts +10 -0
- package/dist/cjs/packages/connect-appliance.cjs +2 -0
- package/dist/cjs/packages/connect-appliance.d.cts +24 -0
- package/dist/cjs/packages/connect-http-api.cjs +2 -0
- package/dist/cjs/packages/connect-http-api.d.cts +15 -0
- package/dist/cjs/packages/connect-interval.cjs +2 -0
- package/dist/cjs/packages/connect-interval.d.cts +15 -0
- package/dist/cjs/packages/connect-modbus.cjs +2 -0
- package/dist/cjs/packages/connect-modbus.d.cts +60 -0
- package/dist/cjs/packages/connect-network-devices.cjs +2 -0
- package/dist/cjs/packages/connect-network-devices.d.cts +40 -0
- package/dist/cjs/packages/connect-storage.cjs +2 -0
- package/dist/cjs/packages/connect-storage.d.cts +14 -0
- package/dist/cjs/packages/energy-app-appliance.cjs +2 -0
- package/dist/cjs/packages/energy-app-appliance.d.cts +17 -0
- package/dist/cjs/packages/energy-app-authentication.cjs +2 -0
- package/dist/cjs/packages/energy-app-authentication.d.cts +52 -0
- package/dist/cjs/packages/energy-app-charge.cjs +2 -0
- package/dist/cjs/packages/energy-app-charge.d.cts +13 -0
- package/dist/cjs/packages/energy-app-charging-card.cjs +2 -0
- package/dist/cjs/packages/energy-app-charging-card.d.cts +11 -0
- package/dist/cjs/packages/energy-app-data-bus.cjs +2 -0
- package/dist/cjs/packages/energy-app-data-bus.d.cts +12 -0
- package/dist/cjs/packages/energy-app-electricity-prices.cjs +2 -0
- package/dist/cjs/packages/energy-app-electricity-prices.d.cts +59 -0
- package/dist/cjs/packages/energy-app-interval.cjs +2 -0
- package/dist/cjs/packages/energy-app-interval.d.cts +15 -0
- package/dist/cjs/packages/energy-app-modbus.cjs +2 -0
- package/dist/cjs/packages/energy-app-modbus.d.cts +46 -0
- package/dist/cjs/packages/energy-app-network-device.cjs +2 -0
- package/dist/cjs/packages/energy-app-network-device.d.cts +25 -0
- package/dist/cjs/packages/energy-app-notification.cjs +2 -0
- package/dist/cjs/packages/energy-app-notification.d.cts +50 -0
- package/dist/cjs/packages/energy-app-ocpp.cjs +16 -0
- package/dist/cjs/packages/energy-app-ocpp.d.cts +52 -0
- package/dist/cjs/packages/energy-app-settings.cjs +2 -0
- package/dist/cjs/packages/energy-app-settings.d.cts +47 -0
- package/dist/cjs/packages/energy-app-storage.cjs +2 -0
- package/dist/cjs/packages/energy-app-storage.d.cts +14 -0
- package/dist/cjs/packages/energy-app-vehicle.cjs +2 -0
- package/dist/cjs/packages/energy-app-vehicle.d.cts +11 -0
- package/dist/cjs/permission-not-granted.cjs +18 -0
- package/dist/cjs/permission-not-granted.d.cts +8 -0
- package/dist/cjs/types/connect-appliance-type.enum.cjs +10 -0
- package/dist/cjs/types/connect-appliance-type.enum.d.cts +6 -0
- package/dist/cjs/types/energy-app-settings.cjs +2 -0
- package/dist/cjs/types/energy-app-settings.d.cts +74 -0
- package/dist/cjs/types/enyo-appliance.cjs +33 -0
- package/dist/cjs/types/enyo-appliance.d.cts +81 -0
- package/dist/cjs/types/enyo-authentication.cjs +9 -0
- package/dist/cjs/types/enyo-authentication.d.cts +69 -0
- package/dist/cjs/types/enyo-battery-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-battery-appliance.d.cts +6 -0
- package/dist/cjs/types/enyo-charge.cjs +15 -0
- package/dist/cjs/types/enyo-charge.d.cts +82 -0
- package/dist/cjs/types/enyo-charger-appliance.cjs +41 -0
- package/dist/cjs/types/enyo-charger-appliance.d.cts +49 -0
- package/dist/cjs/types/enyo-charging-card.cjs +2 -0
- package/dist/cjs/types/enyo-charging-card.d.cts +11 -0
- package/dist/cjs/types/enyo-data-bus-value.cjs +78 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +379 -0
- package/dist/cjs/types/enyo-electricity-prices.cjs +2 -0
- package/dist/cjs/types/enyo-electricity-prices.d.cts +63 -0
- package/dist/cjs/types/enyo-energy-tariff.cjs +2 -0
- package/dist/cjs/types/enyo-energy-tariff.d.cts +70 -0
- package/dist/cjs/types/enyo-heatpump-appliance.cjs +19 -0
- package/dist/cjs/types/enyo-heatpump-appliance.d.cts +34 -0
- package/dist/cjs/types/enyo-inverter-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-inverter-appliance.d.cts +3 -0
- package/dist/cjs/types/enyo-meter-appliance.cjs +10 -0
- package/dist/cjs/types/enyo-meter-appliance.d.cts +10 -0
- package/dist/cjs/types/enyo-network-device.cjs +2 -0
- package/dist/cjs/types/enyo-network-device.d.cts +31 -0
- package/dist/cjs/types/enyo-notification.cjs +2 -0
- package/dist/cjs/types/enyo-notification.d.cts +48 -0
- package/dist/cjs/types/enyo-settings.cjs +2 -0
- package/dist/cjs/types/enyo-settings.d.cts +74 -0
- package/dist/cjs/types/enyo-source.enum.cjs +8 -0
- package/dist/cjs/types/enyo-source.enum.d.cts +4 -0
- package/dist/cjs/types/enyo-vehicle.cjs +2 -0
- package/dist/cjs/types/enyo-vehicle.d.cts +12 -0
- package/dist/cjs/types/enyo-websocket-connection.cjs +2 -0
- package/dist/cjs/types/enyo-websocket-connection.d.cts +8 -0
- package/dist/cjs/types/hems-one-appliance.cjs +33 -0
- package/dist/cjs/types/hems-one-appliance.d.cts +81 -0
- package/dist/cjs/types/hems-one-authentication.cjs +9 -0
- package/dist/cjs/types/hems-one-authentication.d.cts +69 -0
- package/dist/cjs/types/hems-one-battery-appliance.cjs +2 -0
- package/dist/cjs/types/hems-one-battery-appliance.d.cts +6 -0
- package/dist/cjs/types/hems-one-charge.cjs +15 -0
- package/dist/cjs/types/hems-one-charge.d.cts +82 -0
- package/dist/cjs/types/hems-one-charger-appliance.cjs +41 -0
- package/dist/cjs/types/hems-one-charger-appliance.d.cts +49 -0
- package/dist/cjs/types/hems-one-charging-card.cjs +2 -0
- package/dist/cjs/types/hems-one-charging-card.d.cts +11 -0
- package/dist/cjs/types/hems-one-data-bus-command.cjs +9 -0
- package/dist/cjs/types/hems-one-data-bus-command.d.cts +34 -0
- package/dist/cjs/types/hems-one-data-bus-value.cjs +78 -0
- package/dist/cjs/types/hems-one-data-bus-value.d.cts +379 -0
- package/dist/cjs/types/hems-one-electricity-prices.cjs +2 -0
- package/dist/cjs/types/hems-one-electricity-prices.d.cts +63 -0
- package/dist/cjs/types/hems-one-energy-tariff.cjs +2 -0
- package/dist/cjs/types/hems-one-energy-tariff.d.cts +70 -0
- package/dist/cjs/types/hems-one-heatpump-appliance.cjs +19 -0
- package/dist/cjs/types/hems-one-heatpump-appliance.d.cts +34 -0
- package/dist/cjs/types/hems-one-inverter-appliance.cjs +2 -0
- package/dist/cjs/types/hems-one-inverter-appliance.d.cts +3 -0
- package/dist/cjs/types/hems-one-meter-appliance.cjs +10 -0
- package/dist/cjs/types/hems-one-meter-appliance.d.cts +10 -0
- package/dist/cjs/types/hems-one-network-device.cjs +2 -0
- package/dist/cjs/types/hems-one-network-device.d.cts +31 -0
- package/dist/cjs/types/hems-one-source.enum.cjs +8 -0
- package/dist/cjs/types/hems-one-source.enum.d.cts +4 -0
- package/dist/cjs/types/hems-one-vehicle.cjs +2 -0
- package/dist/cjs/types/hems-one-vehicle.d.cts +12 -0
- package/dist/cjs/types/hems-one-websocket-connection.cjs +2 -0
- package/dist/cjs/types/hems-one-websocket-connection.d.cts +8 -0
- package/dist/cjs/version.cjs +19 -0
- package/dist/cjs/version.d.cts +13 -0
- package/dist/connect-ems-api.d.ts +30 -0
- package/dist/connect-ems-api.js +1 -0
- package/dist/connect-ems-permission.enum.d.ts +3 -0
- package/dist/connect-ems-permission.enum.js +4 -0
- package/dist/connect-ems-permission.type.d.ts +1 -0
- package/dist/connect-ems-permission.type.js +1 -0
- package/dist/connect-package-definition.d.ts +57 -0
- package/dist/connect-package-definition.js +10 -0
- package/dist/energy-app-appliance-type.enum.d.ts +10 -0
- package/dist/energy-app-appliance-type.enum.js +11 -0
- package/dist/energy-app-package-configuration.d.ts +30 -0
- package/dist/energy-app-package-configuration.js +1 -0
- package/dist/energy-app-package-definition.d.ts +123 -0
- package/dist/energy-app-package-definition.js +26 -0
- package/dist/energy-app-permission.type.d.ts +18 -0
- package/dist/energy-app-permission.type.js +18 -0
- package/dist/enyo-energy-app-sdk.d.ts +67 -0
- package/dist/enyo-energy-app-sdk.js +9 -0
- package/dist/hems-one-energy-app-sdk.d.ts +67 -0
- package/dist/hems-one-energy-app-sdk.js +9 -0
- package/dist/implementations/modbus/EnergyAppModbusBattery.d.ts +59 -0
- package/dist/implementations/modbus/EnergyAppModbusBattery.js +384 -0
- package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.d.ts +15 -0
- package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.js +33 -0
- package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.d.ts +41 -0
- package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.js +126 -0
- package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.ts +10 -0
- package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.js +45 -0
- package/dist/implementations/modbus/EnergyAppModbusInverter.d.ts +56 -0
- package/dist/implementations/modbus/EnergyAppModbusInverter.js +344 -0
- package/dist/implementations/modbus/EnergyAppModbusMeter.d.ts +26 -0
- package/dist/implementations/modbus/EnergyAppModbusMeter.js +195 -0
- package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.d.ts +13 -0
- package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.js +94 -0
- package/dist/implementations/modbus/interfaces.d.ts +202 -0
- package/dist/implementations/modbus/interfaces.js +23 -0
- package/dist/implementations/ocpp/ocpp-common.d.ts +75 -0
- package/dist/implementations/ocpp/ocpp-common.js +328 -0
- package/dist/implementations/ocpp/ocpp16.d.ts +137 -0
- package/dist/implementations/ocpp/ocpp16.js +48 -0
- package/dist/implementations/ocpp/ocpp201.d.ts +215 -0
- package/dist/implementations/ocpp/ocpp201.js +81 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +99 -0
- package/dist/mockConnectEmsApi.d.ts +10 -0
- package/dist/mockConnectEmsApi.js +160 -0
- package/dist/packages/connect-appliance.d.ts +24 -0
- package/dist/packages/connect-appliance.js +1 -0
- package/dist/packages/connect-http-api.d.ts +15 -0
- package/dist/packages/connect-http-api.js +1 -0
- package/dist/packages/connect-interval.d.ts +15 -0
- package/dist/packages/connect-interval.js +1 -0
- package/dist/packages/connect-modbus.d.ts +60 -0
- package/dist/packages/connect-modbus.js +1 -0
- package/dist/packages/connect-network-devices.d.ts +40 -0
- package/dist/packages/connect-network-devices.js +1 -0
- package/dist/packages/connect-storage.d.ts +14 -0
- package/dist/packages/connect-storage.js +1 -0
- package/dist/packages/energy-app-appliance.d.ts +17 -0
- package/dist/packages/energy-app-appliance.js +1 -0
- package/dist/packages/energy-app-authentication.d.ts +52 -0
- package/dist/packages/energy-app-authentication.js +1 -0
- package/dist/packages/energy-app-charge.d.ts +13 -0
- package/dist/packages/energy-app-charge.js +1 -0
- package/dist/packages/energy-app-charging-card.d.ts +11 -0
- package/dist/packages/energy-app-charging-card.js +1 -0
- package/dist/packages/energy-app-data-bus.d.ts +12 -0
- package/dist/packages/energy-app-data-bus.js +1 -0
- package/dist/packages/energy-app-electricity-prices.d.ts +59 -0
- package/dist/packages/energy-app-electricity-prices.js +1 -0
- package/dist/packages/energy-app-interval.d.ts +15 -0
- package/dist/packages/energy-app-interval.js +1 -0
- package/dist/packages/energy-app-modbus.d.ts +46 -0
- package/dist/packages/energy-app-modbus.js +1 -0
- package/dist/packages/energy-app-network-device.d.ts +25 -0
- package/dist/packages/energy-app-network-device.js +1 -0
- package/dist/packages/energy-app-notification.d.ts +50 -0
- package/dist/packages/energy-app-notification.js +1 -0
- package/dist/packages/energy-app-ocpp.d.ts +52 -0
- package/dist/packages/energy-app-ocpp.js +13 -0
- package/dist/packages/energy-app-settings.d.ts +47 -0
- package/dist/packages/energy-app-settings.js +1 -0
- package/dist/packages/energy-app-storage.d.ts +14 -0
- package/dist/packages/energy-app-storage.js +1 -0
- package/dist/packages/energy-app-vehicle.d.ts +11 -0
- package/dist/packages/energy-app-vehicle.js +1 -0
- package/dist/permission-not-granted.d.ts +8 -0
- package/dist/permission-not-granted.js +14 -0
- package/dist/types/connect-appliance-type.enum.d.ts +6 -0
- package/dist/types/connect-appliance-type.enum.js +7 -0
- package/dist/types/energy-app-settings.d.ts +74 -0
- package/dist/types/energy-app-settings.js +1 -0
- package/dist/types/enyo-appliance.d.ts +81 -0
- package/dist/types/enyo-appliance.js +30 -0
- package/dist/types/enyo-authentication.d.ts +69 -0
- package/dist/types/enyo-authentication.js +6 -0
- package/dist/types/enyo-battery-appliance.d.ts +6 -0
- package/dist/types/enyo-battery-appliance.js +1 -0
- package/dist/types/enyo-charge.d.ts +82 -0
- package/dist/types/enyo-charge.js +12 -0
- package/dist/types/enyo-charger-appliance.d.ts +49 -0
- package/dist/types/enyo-charger-appliance.js +38 -0
- package/dist/types/enyo-charging-card.d.ts +11 -0
- package/dist/types/enyo-charging-card.js +1 -0
- package/dist/types/enyo-data-bus-value.d.ts +379 -0
- package/dist/types/enyo-data-bus-value.js +75 -0
- package/dist/types/enyo-electricity-prices.d.ts +63 -0
- package/dist/types/enyo-electricity-prices.js +1 -0
- package/dist/types/enyo-energy-tariff.d.ts +70 -0
- package/dist/types/enyo-energy-tariff.js +1 -0
- package/dist/types/enyo-heatpump-appliance.d.ts +34 -0
- package/dist/types/enyo-heatpump-appliance.js +16 -0
- package/dist/types/enyo-inverter-appliance.d.ts +3 -0
- package/dist/types/enyo-inverter-appliance.js +1 -0
- package/dist/types/enyo-meter-appliance.d.ts +10 -0
- package/dist/types/enyo-meter-appliance.js +7 -0
- package/dist/types/enyo-network-device.d.ts +31 -0
- package/dist/types/enyo-network-device.js +1 -0
- package/dist/types/enyo-notification.d.ts +48 -0
- package/dist/types/enyo-notification.js +1 -0
- package/dist/types/enyo-settings.d.ts +74 -0
- package/dist/types/enyo-settings.js +1 -0
- package/dist/types/enyo-source.enum.d.ts +4 -0
- package/dist/types/enyo-source.enum.js +5 -0
- package/dist/types/enyo-vehicle.d.ts +12 -0
- package/dist/types/enyo-vehicle.js +1 -0
- package/dist/types/enyo-websocket-connection.d.ts +8 -0
- package/dist/types/enyo-websocket-connection.js +1 -0
- package/dist/types/hems-one-appliance.d.ts +81 -0
- package/dist/types/hems-one-appliance.js +30 -0
- package/dist/types/hems-one-authentication.d.ts +69 -0
- package/dist/types/hems-one-authentication.js +6 -0
- package/dist/types/hems-one-battery-appliance.d.ts +6 -0
- package/dist/types/hems-one-battery-appliance.js +1 -0
- package/dist/types/hems-one-charge.d.ts +82 -0
- package/dist/types/hems-one-charge.js +12 -0
- package/dist/types/hems-one-charger-appliance.d.ts +49 -0
- package/dist/types/hems-one-charger-appliance.js +38 -0
- package/dist/types/hems-one-charging-card.d.ts +11 -0
- package/dist/types/hems-one-charging-card.js +1 -0
- package/dist/types/hems-one-data-bus-command.d.ts +34 -0
- package/dist/types/hems-one-data-bus-command.js +6 -0
- package/dist/types/hems-one-data-bus-value.d.ts +379 -0
- package/dist/types/hems-one-data-bus-value.js +75 -0
- package/dist/types/hems-one-electricity-prices.d.ts +63 -0
- package/dist/types/hems-one-electricity-prices.js +1 -0
- package/dist/types/hems-one-energy-tariff.d.ts +70 -0
- package/dist/types/hems-one-energy-tariff.js +1 -0
- package/dist/types/hems-one-heatpump-appliance.d.ts +34 -0
- package/dist/types/hems-one-heatpump-appliance.js +16 -0
- package/dist/types/hems-one-inverter-appliance.d.ts +3 -0
- package/dist/types/hems-one-inverter-appliance.js +1 -0
- package/dist/types/hems-one-meter-appliance.d.ts +10 -0
- package/dist/types/hems-one-meter-appliance.js +7 -0
- package/dist/types/hems-one-network-device.d.ts +31 -0
- package/dist/types/hems-one-network-device.js +1 -0
- package/dist/types/hems-one-source.enum.d.ts +4 -0
- package/dist/types/hems-one-source.enum.js +5 -0
- package/dist/types/hems-one-vehicle.d.ts +12 -0
- package/dist/types/hems-one-vehicle.js +1 -0
- package/dist/types/hems-one-websocket-connection.d.ts +8 -0
- package/dist/types/hems-one-websocket-connection.js +1 -0
- package/dist/version.d.ts +13 -0
- package/dist/version.js +15 -0
- package/package.json +43 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectorStatusEnumType = exports.RegistrationStatusEnumType = exports.OCPP201Action = void 0;
|
|
4
|
+
var OCPP201Action;
|
|
5
|
+
(function (OCPP201Action) {
|
|
6
|
+
OCPP201Action["Authorize"] = "Authorize";
|
|
7
|
+
OCPP201Action["BootNotification"] = "BootNotification";
|
|
8
|
+
OCPP201Action["CancelReservation"] = "CancelReservation";
|
|
9
|
+
OCPP201Action["CertificateSigned"] = "CertificateSigned";
|
|
10
|
+
OCPP201Action["ChangeAvailability"] = "ChangeAvailability";
|
|
11
|
+
OCPP201Action["ClearCache"] = "ClearCache";
|
|
12
|
+
OCPP201Action["ClearChargingProfile"] = "ClearChargingProfile";
|
|
13
|
+
OCPP201Action["ClearDisplayMessage"] = "ClearDisplayMessage";
|
|
14
|
+
OCPP201Action["ClearVariableMonitoring"] = "ClearVariableMonitoring";
|
|
15
|
+
OCPP201Action["ClearedChargingLimit"] = "ClearedChargingLimit";
|
|
16
|
+
OCPP201Action["CostUpdated"] = "CostUpdated";
|
|
17
|
+
OCPP201Action["CustomerInformation"] = "CustomerInformation";
|
|
18
|
+
OCPP201Action["DataTransfer"] = "DataTransfer";
|
|
19
|
+
OCPP201Action["DeleteCertificate"] = "DeleteCertificate";
|
|
20
|
+
OCPP201Action["FirmwareStatusNotification"] = "FirmwareStatusNotification";
|
|
21
|
+
OCPP201Action["Get15118EVCertificate"] = "Get15118EVCertificate";
|
|
22
|
+
OCPP201Action["GetBaseReport"] = "GetBaseReport";
|
|
23
|
+
OCPP201Action["GetCertificateStatus"] = "GetCertificateStatus";
|
|
24
|
+
OCPP201Action["GetChargingProfiles"] = "GetChargingProfiles";
|
|
25
|
+
OCPP201Action["GetCompositeSchedule"] = "GetCompositeSchedule";
|
|
26
|
+
OCPP201Action["GetDisplayMessages"] = "GetDisplayMessages";
|
|
27
|
+
OCPP201Action["GetInstalledCertificateIds"] = "GetInstalledCertificateIds";
|
|
28
|
+
OCPP201Action["GetLocalListVersion"] = "GetLocalListVersion";
|
|
29
|
+
OCPP201Action["GetLog"] = "GetLog";
|
|
30
|
+
OCPP201Action["GetMonitoringReport"] = "GetMonitoringReport";
|
|
31
|
+
OCPP201Action["GetReport"] = "GetReport";
|
|
32
|
+
OCPP201Action["GetTransactionStatus"] = "GetTransactionStatus";
|
|
33
|
+
OCPP201Action["GetVariables"] = "GetVariables";
|
|
34
|
+
OCPP201Action["Heartbeat"] = "Heartbeat";
|
|
35
|
+
OCPP201Action["InstallCertificate"] = "InstallCertificate";
|
|
36
|
+
OCPP201Action["LogStatusNotification"] = "LogStatusNotification";
|
|
37
|
+
OCPP201Action["MeterValues"] = "MeterValues";
|
|
38
|
+
OCPP201Action["NotifyChargingLimit"] = "NotifyChargingLimit";
|
|
39
|
+
OCPP201Action["NotifyCustomerInformation"] = "NotifyCustomerInformation";
|
|
40
|
+
OCPP201Action["NotifyDisplayMessages"] = "NotifyDisplayMessages";
|
|
41
|
+
OCPP201Action["NotifyEVChargingNeeds"] = "NotifyEVChargingNeeds";
|
|
42
|
+
OCPP201Action["NotifyEVChargingSchedule"] = "NotifyEVChargingSchedule";
|
|
43
|
+
OCPP201Action["NotifyEvent"] = "NotifyEvent";
|
|
44
|
+
OCPP201Action["NotifyMonitoringReport"] = "NotifyMonitoringReport";
|
|
45
|
+
OCPP201Action["NotifyReport"] = "NotifyReport";
|
|
46
|
+
OCPP201Action["PublishFirmware"] = "PublishFirmware";
|
|
47
|
+
OCPP201Action["PublishFirmwareStatusNotification"] = "PublishFirmwareStatusNotification";
|
|
48
|
+
OCPP201Action["ReportChargingProfiles"] = "ReportChargingProfiles";
|
|
49
|
+
OCPP201Action["RequestStartTransaction"] = "RequestStartTransaction";
|
|
50
|
+
OCPP201Action["RequestStopTransaction"] = "RequestStopTransaction";
|
|
51
|
+
OCPP201Action["ReservationStatusUpdate"] = "ReservationStatusUpdate";
|
|
52
|
+
OCPP201Action["ReserveNow"] = "ReserveNow";
|
|
53
|
+
OCPP201Action["Reset"] = "Reset";
|
|
54
|
+
OCPP201Action["SecurityEventNotification"] = "SecurityEventNotification";
|
|
55
|
+
OCPP201Action["SendLocalList"] = "SendLocalList";
|
|
56
|
+
OCPP201Action["SetChargingProfile"] = "SetChargingProfile";
|
|
57
|
+
OCPP201Action["SetDisplayMessage"] = "SetDisplayMessage";
|
|
58
|
+
OCPP201Action["SetMonitoringBase"] = "SetMonitoringBase";
|
|
59
|
+
OCPP201Action["SetMonitoringLevel"] = "SetMonitoringLevel";
|
|
60
|
+
OCPP201Action["SetNetworkProfile"] = "SetNetworkProfile";
|
|
61
|
+
OCPP201Action["SetVariableMonitoring"] = "SetVariableMonitoring";
|
|
62
|
+
OCPP201Action["SetVariables"] = "SetVariables";
|
|
63
|
+
OCPP201Action["SignCertificate"] = "SignCertificate";
|
|
64
|
+
OCPP201Action["StatusNotification"] = "StatusNotification";
|
|
65
|
+
OCPP201Action["TransactionEvent"] = "TransactionEvent";
|
|
66
|
+
OCPP201Action["TriggerMessage"] = "TriggerMessage";
|
|
67
|
+
OCPP201Action["UnlockConnector"] = "UnlockConnector";
|
|
68
|
+
OCPP201Action["UnpublishFirmware"] = "UnpublishFirmware";
|
|
69
|
+
OCPP201Action["UpdateFirmware"] = "UpdateFirmware";
|
|
70
|
+
})(OCPP201Action || (exports.OCPP201Action = OCPP201Action = {}));
|
|
71
|
+
var RegistrationStatusEnumType;
|
|
72
|
+
(function (RegistrationStatusEnumType) {
|
|
73
|
+
RegistrationStatusEnumType["Accepted"] = "Accepted";
|
|
74
|
+
RegistrationStatusEnumType["Pending"] = "Pending";
|
|
75
|
+
RegistrationStatusEnumType["Rejected"] = "Rejected";
|
|
76
|
+
})(RegistrationStatusEnumType || (exports.RegistrationStatusEnumType = RegistrationStatusEnumType = {}));
|
|
77
|
+
var ConnectorStatusEnumType;
|
|
78
|
+
(function (ConnectorStatusEnumType) {
|
|
79
|
+
ConnectorStatusEnumType["Available"] = "Available";
|
|
80
|
+
ConnectorStatusEnumType["Occupied"] = "Occupied";
|
|
81
|
+
ConnectorStatusEnumType["Reserved"] = "Reserved";
|
|
82
|
+
ConnectorStatusEnumType["Unavailable"] = "Unavailable";
|
|
83
|
+
ConnectorStatusEnumType["Faulted"] = "Faulted";
|
|
84
|
+
})(ConnectorStatusEnumType || (exports.ConnectorStatusEnumType = ConnectorStatusEnumType = {}));
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
export declare enum OCPP201Action {
|
|
2
|
+
Authorize = "Authorize",
|
|
3
|
+
BootNotification = "BootNotification",
|
|
4
|
+
CancelReservation = "CancelReservation",
|
|
5
|
+
CertificateSigned = "CertificateSigned",
|
|
6
|
+
ChangeAvailability = "ChangeAvailability",
|
|
7
|
+
ClearCache = "ClearCache",
|
|
8
|
+
ClearChargingProfile = "ClearChargingProfile",
|
|
9
|
+
ClearDisplayMessage = "ClearDisplayMessage",
|
|
10
|
+
ClearVariableMonitoring = "ClearVariableMonitoring",
|
|
11
|
+
ClearedChargingLimit = "ClearedChargingLimit",
|
|
12
|
+
CostUpdated = "CostUpdated",
|
|
13
|
+
CustomerInformation = "CustomerInformation",
|
|
14
|
+
DataTransfer = "DataTransfer",
|
|
15
|
+
DeleteCertificate = "DeleteCertificate",
|
|
16
|
+
FirmwareStatusNotification = "FirmwareStatusNotification",
|
|
17
|
+
Get15118EVCertificate = "Get15118EVCertificate",
|
|
18
|
+
GetBaseReport = "GetBaseReport",
|
|
19
|
+
GetCertificateStatus = "GetCertificateStatus",
|
|
20
|
+
GetChargingProfiles = "GetChargingProfiles",
|
|
21
|
+
GetCompositeSchedule = "GetCompositeSchedule",
|
|
22
|
+
GetDisplayMessages = "GetDisplayMessages",
|
|
23
|
+
GetInstalledCertificateIds = "GetInstalledCertificateIds",
|
|
24
|
+
GetLocalListVersion = "GetLocalListVersion",
|
|
25
|
+
GetLog = "GetLog",
|
|
26
|
+
GetMonitoringReport = "GetMonitoringReport",
|
|
27
|
+
GetReport = "GetReport",
|
|
28
|
+
GetTransactionStatus = "GetTransactionStatus",
|
|
29
|
+
GetVariables = "GetVariables",
|
|
30
|
+
Heartbeat = "Heartbeat",
|
|
31
|
+
InstallCertificate = "InstallCertificate",
|
|
32
|
+
LogStatusNotification = "LogStatusNotification",
|
|
33
|
+
MeterValues = "MeterValues",
|
|
34
|
+
NotifyChargingLimit = "NotifyChargingLimit",
|
|
35
|
+
NotifyCustomerInformation = "NotifyCustomerInformation",
|
|
36
|
+
NotifyDisplayMessages = "NotifyDisplayMessages",
|
|
37
|
+
NotifyEVChargingNeeds = "NotifyEVChargingNeeds",
|
|
38
|
+
NotifyEVChargingSchedule = "NotifyEVChargingSchedule",
|
|
39
|
+
NotifyEvent = "NotifyEvent",
|
|
40
|
+
NotifyMonitoringReport = "NotifyMonitoringReport",
|
|
41
|
+
NotifyReport = "NotifyReport",
|
|
42
|
+
PublishFirmware = "PublishFirmware",
|
|
43
|
+
PublishFirmwareStatusNotification = "PublishFirmwareStatusNotification",
|
|
44
|
+
ReportChargingProfiles = "ReportChargingProfiles",
|
|
45
|
+
RequestStartTransaction = "RequestStartTransaction",
|
|
46
|
+
RequestStopTransaction = "RequestStopTransaction",
|
|
47
|
+
ReservationStatusUpdate = "ReservationStatusUpdate",
|
|
48
|
+
ReserveNow = "ReserveNow",
|
|
49
|
+
Reset = "Reset",
|
|
50
|
+
SecurityEventNotification = "SecurityEventNotification",
|
|
51
|
+
SendLocalList = "SendLocalList",
|
|
52
|
+
SetChargingProfile = "SetChargingProfile",
|
|
53
|
+
SetDisplayMessage = "SetDisplayMessage",
|
|
54
|
+
SetMonitoringBase = "SetMonitoringBase",
|
|
55
|
+
SetMonitoringLevel = "SetMonitoringLevel",
|
|
56
|
+
SetNetworkProfile = "SetNetworkProfile",
|
|
57
|
+
SetVariableMonitoring = "SetVariableMonitoring",
|
|
58
|
+
SetVariables = "SetVariables",
|
|
59
|
+
SignCertificate = "SignCertificate",
|
|
60
|
+
StatusNotification = "StatusNotification",
|
|
61
|
+
TransactionEvent = "TransactionEvent",
|
|
62
|
+
TriggerMessage = "TriggerMessage",
|
|
63
|
+
UnlockConnector = "UnlockConnector",
|
|
64
|
+
UnpublishFirmware = "UnpublishFirmware",
|
|
65
|
+
UpdateFirmware = "UpdateFirmware"
|
|
66
|
+
}
|
|
67
|
+
export declare enum RegistrationStatusEnumType {
|
|
68
|
+
Accepted = "Accepted",
|
|
69
|
+
Pending = "Pending",
|
|
70
|
+
Rejected = "Rejected"
|
|
71
|
+
}
|
|
72
|
+
export declare enum ConnectorStatusEnumType {
|
|
73
|
+
Available = "Available",
|
|
74
|
+
Occupied = "Occupied",
|
|
75
|
+
Reserved = "Reserved",
|
|
76
|
+
Unavailable = "Unavailable",
|
|
77
|
+
Faulted = "Faulted"
|
|
78
|
+
}
|
|
79
|
+
export interface OCPP201BootNotificationRequest {
|
|
80
|
+
chargingStation: {
|
|
81
|
+
model: string;
|
|
82
|
+
vendorName: string;
|
|
83
|
+
firmwareVersion?: string;
|
|
84
|
+
serialNumber?: string;
|
|
85
|
+
modem?: {
|
|
86
|
+
iccid?: string;
|
|
87
|
+
imsi?: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
reason: 'ApplicationReset' | 'FirmwareUpdate' | 'LocalReset' | 'PowerUp' | 'RemoteReset' | 'ScheduledReset' | 'Triggered' | 'Unknown' | 'Watchdog';
|
|
91
|
+
}
|
|
92
|
+
export interface OCPP201BootNotificationResponse {
|
|
93
|
+
currentTime: string;
|
|
94
|
+
interval: number;
|
|
95
|
+
status: RegistrationStatusEnumType;
|
|
96
|
+
statusInfo?: {
|
|
97
|
+
reasonCode: string;
|
|
98
|
+
additionalInfo?: string;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export interface OCPP201HeartbeatRequest {
|
|
102
|
+
}
|
|
103
|
+
export interface OCPP201HeartbeatResponse {
|
|
104
|
+
currentTime: string;
|
|
105
|
+
}
|
|
106
|
+
export interface OCPP201StatusNotificationRequest {
|
|
107
|
+
timestamp: string;
|
|
108
|
+
connectorStatus: ConnectorStatusEnumType;
|
|
109
|
+
evseId: number;
|
|
110
|
+
connectorId: number;
|
|
111
|
+
}
|
|
112
|
+
export interface OCPP201StatusNotificationResponse {
|
|
113
|
+
}
|
|
114
|
+
export interface OCPP201AuthorizeRequest {
|
|
115
|
+
idToken: {
|
|
116
|
+
idToken: string;
|
|
117
|
+
type: 'Central' | 'eMAID' | 'ISO14443' | 'ISO15693' | 'KeyCode' | 'Local' | 'MacAddress' | 'NoAuthorization';
|
|
118
|
+
additionalInfo?: Array<{
|
|
119
|
+
additionalIdToken: string;
|
|
120
|
+
type: string;
|
|
121
|
+
}>;
|
|
122
|
+
};
|
|
123
|
+
certificate?: string;
|
|
124
|
+
iso15118CertificateHashData?: Array<{
|
|
125
|
+
hashAlgorithm: 'SHA256' | 'SHA384' | 'SHA512';
|
|
126
|
+
issuerNameHash: string;
|
|
127
|
+
issuerKeyHash: string;
|
|
128
|
+
serialNumber: string;
|
|
129
|
+
}>;
|
|
130
|
+
}
|
|
131
|
+
export interface OCPP201AuthorizeResponse {
|
|
132
|
+
idTokenInfo: {
|
|
133
|
+
status: 'Accepted' | 'Blocked' | 'ConcurrentTx' | 'Expired' | 'Invalid' | 'NoCredit' | 'NotAllowedTypeEVSE' | 'NotAtThisLocation' | 'NotAtThisTime' | 'Unknown';
|
|
134
|
+
cacheExpiryDateTime?: string;
|
|
135
|
+
chargingPriority?: number;
|
|
136
|
+
language1?: string;
|
|
137
|
+
language2?: string;
|
|
138
|
+
groupIdToken?: {
|
|
139
|
+
idToken: string;
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
personalMessage?: {
|
|
143
|
+
format: 'ASCII' | 'HTML' | 'URI' | 'UTF8';
|
|
144
|
+
language?: string;
|
|
145
|
+
content: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
certificateStatus?: 'Accepted' | 'SignatureError' | 'CertificateExpired' | 'CertificateRevoked' | 'NoCertificateAvailable' | 'CertChainError' | 'ContractCancelled';
|
|
149
|
+
}
|
|
150
|
+
export interface OCPP201TransactionEventRequest {
|
|
151
|
+
eventType: 'Ended' | 'Started' | 'Updated';
|
|
152
|
+
timestamp: string;
|
|
153
|
+
triggerReason: 'Authorized' | 'CablePluggedIn' | 'ChargingRateChanged' | 'ChargingStateChanged' | 'Deauthorized' | 'EnergyLimitReached' | 'EVCommunicationLost' | 'EVConnectTimeout' | 'MeterValueClock' | 'MeterValuePeriodic' | 'TimeLimitReached' | 'Trigger' | 'UnlockCommand' | 'StopAuthorized' | 'EVDeparted' | 'EVDetected' | 'RemoteStop' | 'RemoteStart' | 'AbnormalCondition' | 'SignedDataReceived' | 'ResetCommand';
|
|
154
|
+
seqNo: number;
|
|
155
|
+
transactionInfo: {
|
|
156
|
+
transactionId: string;
|
|
157
|
+
chargingState?: 'Charging' | 'EVConnected' | 'SuspendedEV' | 'SuspendedEVSE' | 'Idle';
|
|
158
|
+
timeSpentCharging?: number;
|
|
159
|
+
stoppedReason?: 'DeAuthorized' | 'EmergencyStop' | 'EnergyLimitReached' | 'EVDisconnected' | 'GroundFault' | 'ImmediateReset' | 'Local' | 'LocalOutOfCredit' | 'MasterPass' | 'Other' | 'OvercurrentFault' | 'PowerLoss' | 'PowerQuality' | 'Reboot' | 'Remote' | 'SOCLimitReached' | 'StoppedByEV' | 'TimeLimitReached' | 'Timeout';
|
|
160
|
+
remoteStartId?: number;
|
|
161
|
+
};
|
|
162
|
+
evse?: {
|
|
163
|
+
id: number;
|
|
164
|
+
connectorId?: number;
|
|
165
|
+
};
|
|
166
|
+
idToken?: {
|
|
167
|
+
idToken: string;
|
|
168
|
+
type: string;
|
|
169
|
+
};
|
|
170
|
+
meterValue?: Array<{
|
|
171
|
+
timestamp: string;
|
|
172
|
+
sampledValue: Array<{
|
|
173
|
+
value: number;
|
|
174
|
+
context?: 'Transaction.Begin' | 'Transaction.End' | 'Sample.Clock' | 'Sample.Periodic' | 'Trigger' | 'Interruption.Begin' | 'Interruption.End';
|
|
175
|
+
measurand?: 'Energy.Active.Import' | 'Energy.Active.Export.Register' | 'Power.Active.Import' | 'Power.Active.Export' | 'Current.Import' | 'Voltage' | 'Temperature' | 'Frequency' | 'Current.Export' | 'Current.Offered' | 'SoC';
|
|
176
|
+
phase?: 'L1' | 'L2' | 'L3';
|
|
177
|
+
location?: 'Body' | 'Cable' | 'EV' | 'Inlet' | 'Outlet';
|
|
178
|
+
signedMeterValue?: {
|
|
179
|
+
signedMeterData: string;
|
|
180
|
+
signingMethod: string;
|
|
181
|
+
encodingMethod: string;
|
|
182
|
+
publicKey: string;
|
|
183
|
+
};
|
|
184
|
+
unitOfMeasure?: {
|
|
185
|
+
unit?: 'Wh' | 'W' | 'A' | 'Hz' | 'kW' | 'kWh';
|
|
186
|
+
multiplier?: number;
|
|
187
|
+
};
|
|
188
|
+
}>;
|
|
189
|
+
}>;
|
|
190
|
+
}
|
|
191
|
+
export interface OCPP201TransactionEventResponse {
|
|
192
|
+
totalCost?: number;
|
|
193
|
+
chargingPriority?: number;
|
|
194
|
+
idTokenInfo?: {
|
|
195
|
+
status: string;
|
|
196
|
+
cacheExpiryDateTime?: string;
|
|
197
|
+
chargingPriority?: number;
|
|
198
|
+
language1?: string;
|
|
199
|
+
language2?: string;
|
|
200
|
+
groupIdToken?: {
|
|
201
|
+
idToken: string;
|
|
202
|
+
type: string;
|
|
203
|
+
};
|
|
204
|
+
personalMessage?: {
|
|
205
|
+
format: string;
|
|
206
|
+
language?: string;
|
|
207
|
+
content: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
updatedPersonalMessage?: {
|
|
211
|
+
format: string;
|
|
212
|
+
language?: string;
|
|
213
|
+
content: string;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.EnergyApp = void 0;
|
|
18
|
+
const version_js_1 = require("./version.cjs");
|
|
19
|
+
__exportStar(require("./energy-app-package-definition.cjs"), exports);
|
|
20
|
+
__exportStar(require("./implementations/modbus/EnergyAppModbusBattery.cjs"), exports);
|
|
21
|
+
__exportStar(require("./implementations/modbus/EnergyAppModbusMeter.cjs"), exports);
|
|
22
|
+
__exportStar(require("./implementations/modbus/EnergyAppModbusInverter.cjs"), exports);
|
|
23
|
+
__exportStar(require("./version.cjs"), exports);
|
|
24
|
+
__exportStar(require("./implementations/ocpp/ocpp16.cjs"), exports);
|
|
25
|
+
__exportStar(require("./implementations/ocpp/ocpp201.cjs"), exports);
|
|
26
|
+
__exportStar(require("./implementations/ocpp/ocpp-common.cjs"), exports);
|
|
27
|
+
__exportStar(require("./types/enyo-authentication.cjs"), exports);
|
|
28
|
+
__exportStar(require("./types/enyo-settings.cjs"), exports);
|
|
29
|
+
__exportStar(require("./types/enyo-energy-tariff.cjs"), exports);
|
|
30
|
+
__exportStar(require("./types/enyo-electricity-prices.cjs"), exports);
|
|
31
|
+
__exportStar(require("./types/enyo-notification.cjs"), exports);
|
|
32
|
+
class EnergyApp {
|
|
33
|
+
energyAppSdk;
|
|
34
|
+
constructor() {
|
|
35
|
+
// in our runtime, there is an instance of energyAppSdk available which needs to be used here
|
|
36
|
+
// if the energyAppSdk is not available, instantiate a mocked version for local development
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
if (energyAppSdkInstance === undefined || energyAppSdkInstance === null) {
|
|
39
|
+
throw new Error('Missing energyAppSdk instance');
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
this.energyAppSdk = energyAppSdkInstance;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
isSystemOnline() {
|
|
47
|
+
return this.energyAppSdk.isSystemOnline();
|
|
48
|
+
}
|
|
49
|
+
updateEnergyAppState(state) {
|
|
50
|
+
this.energyAppSdk.updateEnergyAppState(state);
|
|
51
|
+
}
|
|
52
|
+
register(callback) {
|
|
53
|
+
// This registers the package with the enyo system
|
|
54
|
+
this.energyAppSdk.register(callback);
|
|
55
|
+
}
|
|
56
|
+
onShutdown(callback) {
|
|
57
|
+
process.on('beforeExit', async (code) => {
|
|
58
|
+
await callback();
|
|
59
|
+
});
|
|
60
|
+
process.on('exit', async (code) => {
|
|
61
|
+
await callback();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
useFetch() {
|
|
65
|
+
return this.energyAppSdk.useFetch();
|
|
66
|
+
}
|
|
67
|
+
useInterval() {
|
|
68
|
+
return this.energyAppSdk.useInterval();
|
|
69
|
+
}
|
|
70
|
+
useModbus() {
|
|
71
|
+
return this.energyAppSdk.useModbus();
|
|
72
|
+
}
|
|
73
|
+
useNetworkDevices() {
|
|
74
|
+
return this.energyAppSdk.useNetworkDevices();
|
|
75
|
+
}
|
|
76
|
+
useStorage() {
|
|
77
|
+
return this.energyAppSdk.useStorage();
|
|
78
|
+
}
|
|
79
|
+
useAppliances() {
|
|
80
|
+
return this.energyAppSdk.useAppliances();
|
|
81
|
+
}
|
|
82
|
+
useDataBus() {
|
|
83
|
+
return this.energyAppSdk.useDataBus();
|
|
84
|
+
}
|
|
85
|
+
useOcpp() {
|
|
86
|
+
return this.energyAppSdk.useOcpp();
|
|
87
|
+
}
|
|
88
|
+
useVehicle() {
|
|
89
|
+
return this.energyAppSdk.useVehicle();
|
|
90
|
+
}
|
|
91
|
+
useChargingCard() {
|
|
92
|
+
return this.energyAppSdk.useChargingCard();
|
|
93
|
+
}
|
|
94
|
+
useCharge() {
|
|
95
|
+
return this.energyAppSdk.useCharge();
|
|
96
|
+
}
|
|
97
|
+
useAuthentication() {
|
|
98
|
+
return this.energyAppSdk.useAuthentication();
|
|
99
|
+
}
|
|
100
|
+
useSettings() {
|
|
101
|
+
return this.energyAppSdk.useSettings();
|
|
102
|
+
}
|
|
103
|
+
useElectricityPrices() {
|
|
104
|
+
return this.energyAppSdk.useElectricityPrices();
|
|
105
|
+
}
|
|
106
|
+
useNotification() {
|
|
107
|
+
return this.energyAppSdk.useNotification();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Gets the current SDK version.
|
|
111
|
+
* @returns The semantic version string of the SDK
|
|
112
|
+
*/
|
|
113
|
+
getSdkVersion() {
|
|
114
|
+
return (0, version_js_1.getSdkVersion)();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.EnergyApp = EnergyApp;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { EnergyAppStateEnum, EnyoEnergyAppSdk } from "./enyo-energy-app-sdk.cjs";
|
|
2
|
+
import { EnergyAppInterval } from "./packages/energy-app-interval.cjs";
|
|
3
|
+
import { EnergyAppModbus } from "./packages/energy-app-modbus.cjs";
|
|
4
|
+
import { EnergyAppStorage } from "./packages/energy-app-storage.cjs";
|
|
5
|
+
import { EnergyAppAppliance } from "./packages/energy-app-appliance.cjs";
|
|
6
|
+
import { EnergyAppNetworkDevice } from "./packages/energy-app-network-device.cjs";
|
|
7
|
+
import { EnergyAppDataBus } from "./packages/energy-app-data-bus.cjs";
|
|
8
|
+
import { EnergyAppOcpp } from "./packages/energy-app-ocpp.cjs";
|
|
9
|
+
import { EnergyAppVehicle } from "./packages/energy-app-vehicle.cjs";
|
|
10
|
+
import { EnergyAppChargingCard } from "./packages/energy-app-charging-card.cjs";
|
|
11
|
+
import { EnergyAppCharge } from "./packages/energy-app-charge.cjs";
|
|
12
|
+
import { EnergyAppAuthentication } from "./packages/energy-app-authentication.cjs";
|
|
13
|
+
import { EnergyAppSettings } from "./packages/energy-app-settings.cjs";
|
|
14
|
+
import { EnergyAppElectricityPrices } from "./packages/energy-app-electricity-prices.cjs";
|
|
15
|
+
import { EnergyAppNotification } from "./packages/energy-app-notification.cjs";
|
|
16
|
+
export * from './energy-app-package-definition.cjs';
|
|
17
|
+
export * from './implementations/modbus/EnergyAppModbusBattery.cjs';
|
|
18
|
+
export * from './implementations/modbus/EnergyAppModbusMeter.cjs';
|
|
19
|
+
export * from './implementations/modbus/EnergyAppModbusInverter.cjs';
|
|
20
|
+
export * from './version.cjs';
|
|
21
|
+
export * from './implementations/ocpp/ocpp16.cjs';
|
|
22
|
+
export * from './implementations/ocpp/ocpp201.cjs';
|
|
23
|
+
export * from './implementations/ocpp/ocpp-common.cjs';
|
|
24
|
+
export * from './types/enyo-authentication.cjs';
|
|
25
|
+
export * from './types/enyo-settings.cjs';
|
|
26
|
+
export * from './types/enyo-energy-tariff.cjs';
|
|
27
|
+
export * from './types/enyo-electricity-prices.cjs';
|
|
28
|
+
export * from './types/enyo-notification.cjs';
|
|
29
|
+
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
30
|
+
private readonly energyAppSdk;
|
|
31
|
+
constructor();
|
|
32
|
+
isSystemOnline(): boolean;
|
|
33
|
+
updateEnergyAppState(state: EnergyAppStateEnum): void;
|
|
34
|
+
register(callback: (packageName: string, version: number) => void): void;
|
|
35
|
+
onShutdown(callback: () => Promise<void>): void;
|
|
36
|
+
useFetch(): typeof fetch;
|
|
37
|
+
useInterval(): EnergyAppInterval;
|
|
38
|
+
useModbus(): EnergyAppModbus;
|
|
39
|
+
useNetworkDevices(): EnergyAppNetworkDevice;
|
|
40
|
+
useStorage(): EnergyAppStorage;
|
|
41
|
+
useAppliances(): EnergyAppAppliance;
|
|
42
|
+
useDataBus(): EnergyAppDataBus;
|
|
43
|
+
useOcpp(): EnergyAppOcpp;
|
|
44
|
+
useVehicle(): EnergyAppVehicle;
|
|
45
|
+
useChargingCard(): EnergyAppChargingCard;
|
|
46
|
+
useCharge(): EnergyAppCharge;
|
|
47
|
+
useAuthentication(): EnergyAppAuthentication;
|
|
48
|
+
useSettings(): EnergyAppSettings;
|
|
49
|
+
useElectricityPrices(): EnergyAppElectricityPrices;
|
|
50
|
+
useNotification(): EnergyAppNotification;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the current SDK version.
|
|
53
|
+
* @returns The semantic version string of the SDK
|
|
54
|
+
*/
|
|
55
|
+
getSdkVersion(): string;
|
|
56
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MockConnectEmsApi = void 0;
|
|
7
|
+
const express_1 = __importDefault(require("express"));
|
|
8
|
+
class MockConnectEmsApi {
|
|
9
|
+
register(callback) {
|
|
10
|
+
console.log('MockConnectEmsApi: Registering package with Connect EMS API');
|
|
11
|
+
const app = (0, express_1.default)();
|
|
12
|
+
app.use(express_1.default.json());
|
|
13
|
+
app.get('/', (req, res) => {
|
|
14
|
+
});
|
|
15
|
+
app.listen(4001, () => {
|
|
16
|
+
callback('com.example', 1);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
shutdown(callback) {
|
|
20
|
+
}
|
|
21
|
+
isOnline() {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
useHttp() {
|
|
25
|
+
return {
|
|
26
|
+
isPermitted: () => true,
|
|
27
|
+
get: async (url, options) => {
|
|
28
|
+
try {
|
|
29
|
+
const response = await fetch(url, {
|
|
30
|
+
method: 'GET',
|
|
31
|
+
headers: options?.headers
|
|
32
|
+
});
|
|
33
|
+
const data = await response.json();
|
|
34
|
+
return {
|
|
35
|
+
status: response.status,
|
|
36
|
+
data
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
status: 0,
|
|
42
|
+
data: { message: error?.toString() }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
post: async (url, body, options) => {
|
|
47
|
+
try {
|
|
48
|
+
const response = await fetch(url, {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers: {
|
|
51
|
+
'Content-Type': 'application/json',
|
|
52
|
+
...options?.headers
|
|
53
|
+
},
|
|
54
|
+
body: body ? JSON.stringify(body) : undefined
|
|
55
|
+
});
|
|
56
|
+
const data = await response.json();
|
|
57
|
+
return {
|
|
58
|
+
status: response.status,
|
|
59
|
+
data
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return {
|
|
64
|
+
status: 0,
|
|
65
|
+
data: { message: error?.toString() }
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
put: async (url, body, options) => {
|
|
70
|
+
try {
|
|
71
|
+
const response = await fetch(url, {
|
|
72
|
+
method: 'PUT',
|
|
73
|
+
headers: {
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
...options?.headers
|
|
76
|
+
},
|
|
77
|
+
body: body ? JSON.stringify(body) : undefined
|
|
78
|
+
});
|
|
79
|
+
const data = await response.json();
|
|
80
|
+
return {
|
|
81
|
+
status: response.status,
|
|
82
|
+
data
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
status: 0,
|
|
88
|
+
data: { message: error?.toString() }
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
patch: async (url, body, options) => {
|
|
93
|
+
try {
|
|
94
|
+
const response = await fetch(url, {
|
|
95
|
+
method: 'PATCH',
|
|
96
|
+
headers: {
|
|
97
|
+
'Content-Type': 'application/json',
|
|
98
|
+
...options?.headers
|
|
99
|
+
},
|
|
100
|
+
body: body ? JSON.stringify(body) : undefined
|
|
101
|
+
});
|
|
102
|
+
const data = await response.json();
|
|
103
|
+
return {
|
|
104
|
+
status: response.status,
|
|
105
|
+
data
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return {
|
|
110
|
+
status: 0,
|
|
111
|
+
data: { message: error?.toString() }
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
delete: async (url, options) => {
|
|
116
|
+
try {
|
|
117
|
+
const response = await fetch(url, {
|
|
118
|
+
method: 'DELETE',
|
|
119
|
+
headers: options?.headers
|
|
120
|
+
});
|
|
121
|
+
const data = await response.json();
|
|
122
|
+
return {
|
|
123
|
+
status: response.status,
|
|
124
|
+
data
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return {
|
|
129
|
+
status: 0,
|
|
130
|
+
data: { message: error?.toString() }
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
useInterval() {
|
|
137
|
+
const intervals = new Map();
|
|
138
|
+
let nextId = 0;
|
|
139
|
+
const durationToMs = (duration) => {
|
|
140
|
+
switch (duration) {
|
|
141
|
+
case '1s': return 1000;
|
|
142
|
+
case '10s': return 10000;
|
|
143
|
+
case '30s': return 30000;
|
|
144
|
+
case '1m': return 60000;
|
|
145
|
+
case '5m': return 300000;
|
|
146
|
+
case '1hr': return 3600000;
|
|
147
|
+
default: throw new Error(`Unsupported duration: ${duration}`);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
return {
|
|
151
|
+
createInterval: (duration, callback) => {
|
|
152
|
+
const intervalId = `interval_${++nextId}`;
|
|
153
|
+
const nodeInterval = setInterval(callback, durationToMs(duration));
|
|
154
|
+
intervals.set(intervalId, nodeInterval);
|
|
155
|
+
return intervalId;
|
|
156
|
+
},
|
|
157
|
+
stopInterval: (intervalId) => {
|
|
158
|
+
const nodeInterval = intervals.get(intervalId);
|
|
159
|
+
if (nodeInterval) {
|
|
160
|
+
clearInterval(nodeInterval);
|
|
161
|
+
intervals.delete(intervalId);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
exports.MockConnectEmsApi = MockConnectEmsApi;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectEmsApi } from "./connect-ems-api.cjs";
|
|
2
|
+
import { ConnectHttpApi } from "./packages/connect-http-api.cjs";
|
|
3
|
+
import { ConnectInterval } from "./packages/connect-interval.cjs";
|
|
4
|
+
export declare class MockConnectEmsApi implements ConnectEmsApi {
|
|
5
|
+
register(callback: (packageName: string, version: number) => void): void;
|
|
6
|
+
shutdown(callback: () => void): void;
|
|
7
|
+
isOnline(): boolean;
|
|
8
|
+
useHttp(): ConnectHttpApi;
|
|
9
|
+
useInterval(): ConnectInterval;
|
|
10
|
+
}
|