freeathome-local-api-client 0.2.0-pre
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/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/bundle.js +2 -0
- package/dist/bundle.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/model/channel.d.ts +20 -0
- package/dist/src/model/channel.d.ts.map +1 -0
- package/dist/src/model/configuration.d.ts +10 -0
- package/dist/src/model/configuration.d.ts.map +1 -0
- package/dist/src/model/device-list.d.ts +9 -0
- package/dist/src/model/device-list.d.ts.map +1 -0
- package/dist/src/model/device-response.d.ts +12 -0
- package/dist/src/model/device-response.d.ts.map +1 -0
- package/dist/src/model/device.d.ts +17 -0
- package/dist/src/model/device.d.ts.map +1 -0
- package/dist/src/model/devices.d.ts +10 -0
- package/dist/src/model/devices.d.ts.map +1 -0
- package/dist/src/model/error.d.ts +11 -0
- package/dist/src/model/error.d.ts.map +1 -0
- package/dist/src/model/floors.d.ts +13 -0
- package/dist/src/model/floors.d.ts.map +1 -0
- package/dist/src/model/get-data-point-response.d.ts +11 -0
- package/dist/src/model/get-data-point-response.d.ts.map +1 -0
- package/dist/src/model/in-out-put.d.ts +10 -0
- package/dist/src/model/in-out-put.d.ts.map +1 -0
- package/dist/src/model/index.d.ts +20 -0
- package/dist/src/model/index.d.ts.map +1 -0
- package/dist/src/model/rooms.d.ts +11 -0
- package/dist/src/model/rooms.d.ts.map +1 -0
- package/dist/src/model/scenes-triggered.d.ts +20 -0
- package/dist/src/model/scenes-triggered.d.ts.map +1 -0
- package/dist/src/model/set-data-point-response.d.ts +11 -0
- package/dist/src/model/set-data-point-response.d.ts.map +1 -0
- package/dist/src/model/sys-ap.d.ts +18 -0
- package/dist/src/model/sys-ap.d.ts.map +1 -0
- package/dist/src/model/users.d.ts +17 -0
- package/dist/src/model/users.d.ts.map +1 -0
- package/dist/src/model/validation/channel-ti.d.ts +3 -0
- package/dist/src/model/validation/channel-ti.d.ts.map +1 -0
- package/dist/src/model/validation/configuration-ti.d.ts +3 -0
- package/dist/src/model/validation/configuration-ti.d.ts.map +1 -0
- package/dist/src/model/validation/device-list-ti.d.ts +3 -0
- package/dist/src/model/validation/device-list-ti.d.ts.map +1 -0
- package/dist/src/model/validation/device-response-ti.d.ts +3 -0
- package/dist/src/model/validation/device-response-ti.d.ts.map +1 -0
- package/dist/src/model/validation/device-ti.d.ts +3 -0
- package/dist/src/model/validation/device-ti.d.ts.map +1 -0
- package/dist/src/model/validation/devices-ti.d.ts +3 -0
- package/dist/src/model/validation/devices-ti.d.ts.map +1 -0
- package/dist/src/model/validation/error-ti.d.ts +3 -0
- package/dist/src/model/validation/error-ti.d.ts.map +1 -0
- package/dist/src/model/validation/floors-ti.d.ts +3 -0
- package/dist/src/model/validation/floors-ti.d.ts.map +1 -0
- package/dist/src/model/validation/get-data-point-response-ti.d.ts +3 -0
- package/dist/src/model/validation/get-data-point-response-ti.d.ts.map +1 -0
- package/dist/src/model/validation/in-out-put-ti.d.ts +3 -0
- package/dist/src/model/validation/in-out-put-ti.d.ts.map +1 -0
- package/dist/src/model/validation/index.d.ts +18 -0
- package/dist/src/model/validation/index.d.ts.map +1 -0
- package/dist/src/model/validation/rooms-ti.d.ts +3 -0
- package/dist/src/model/validation/rooms-ti.d.ts.map +1 -0
- package/dist/src/model/validation/scenes-triggered-ti.d.ts +3 -0
- package/dist/src/model/validation/scenes-triggered-ti.d.ts.map +1 -0
- package/dist/src/model/validation/set-data-point-response-ti.d.ts +3 -0
- package/dist/src/model/validation/set-data-point-response-ti.d.ts.map +1 -0
- package/dist/src/model/validation/sys-ap-ti.d.ts +3 -0
- package/dist/src/model/validation/sys-ap-ti.d.ts.map +1 -0
- package/dist/src/model/validation/users-ti.d.ts +3 -0
- package/dist/src/model/validation/users-ti.d.ts.map +1 -0
- package/dist/src/model/validation/virtual-device-response-ti.d.ts +3 -0
- package/dist/src/model/validation/virtual-device-response-ti.d.ts.map +1 -0
- package/dist/src/model/validation/websocket-message-ti.d.ts +3 -0
- package/dist/src/model/validation/websocket-message-ti.d.ts.map +1 -0
- package/dist/src/model/validator.d.ts +57 -0
- package/dist/src/model/validator.d.ts.map +1 -0
- package/dist/src/model/virtual-device-response.d.ts +15 -0
- package/dist/src/model/virtual-device-response.d.ts.map +1 -0
- package/dist/src/model/virtual-device.d.ts +58 -0
- package/dist/src/model/virtual-device.d.ts.map +1 -0
- package/dist/src/model/websocket-message.d.ts +21 -0
- package/dist/src/model/websocket-message.d.ts.map +1 -0
- package/dist/src/system-access-point.d.ts +96 -0
- package/dist/src/system-access-point.d.ts.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Philip Gerke
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# freeathome-local-api-client
|
|
2
|
+
|
|
3
|
+
A client library for the BUSCH-JAEGER free@home local API implemented in TypeScript
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
TBD
|
|
8
|
+
|
|
9
|
+
## Usage Requirements
|
|
10
|
+
|
|
11
|
+
- A free@home system access point running firmware > v3.0
|
|
12
|
+
- Local API has to be enabled for the user account to be used
|
|
13
|
+
|
|
14
|
+
## Documentation
|
|
15
|
+
|
|
16
|
+
TBD
|
|
17
|
+
|
|
18
|
+
## I found a bug, what do I do?
|
|
19
|
+
|
|
20
|
+
I'm happy to hear any feedback regarding the library or it's implementation, be it critizism, praise or rants. Please create a [GitHub issue](https://github.com/pgerke/freeathome-local-api-client/issues) or drop me an [email](mailto:info@philipgerke.com) if you would like to contact me.
|
|
21
|
+
|
|
22
|
+
I would especially appreciate, if you could report any issues you encounter while using the library. Issues I know about, I can probably fix.
|
|
23
|
+
|
|
24
|
+
If you want to submit a bug report, please check if the issue you have has already been reported. If you want to contribute additional information to the issue, please add it to the existing issue instead of creating another one. Duplicate issues will take time from bugfixing and thus delay a fix.
|
|
25
|
+
|
|
26
|
+
While creating a bug report, please make it easy for me to fix it by giving us all the details you have about the issue. Always include the version of the library and a short concise description of the issue. Besides that, there are a few other pieces of information that help tracking down bugs:
|
|
27
|
+
|
|
28
|
+
- The system environment in which the issue occurred (e.g. node version)
|
|
29
|
+
- Some steps to reproduce the issue, e.g. a code snippet
|
|
30
|
+
- The expected behaviour and how the failed failed to meet that expectation
|
|
31
|
+
- Anything else you think I might need
|
|
32
|
+
|
|
33
|
+
## I have a feature request, what do I do?
|
|
34
|
+
|
|
35
|
+
Please create a [GitHub issue](https://github.com/pgerke/freeathome-local-api-client/issues) or drop me an [email](mailto:info@philipgerke.com)
|
|
36
|
+
|
|
37
|
+
## Non-Affiliation Disclaimer
|
|
38
|
+
|
|
39
|
+
This library is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by Busch-Jaeger Elektro GmbH or ABB Asea Brown Boveri Ltd or . All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
The project is subject to the MIT license unless otherwise noted. A copy can be found in the root directory of the project [LICENSE](./LICENSE).
|
|
44
|
+
|
|
45
|
+
<hr>
|
|
46
|
+
|
|
47
|
+
Made with ❤️ by [Philip Gerke](https://github.com/pgerke)
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"ts-interface-checker";import*as t from"ws";var r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},n={};r.d(n,{ns:()=>De,LB:()=>T,s:()=>K,L$:()=>M,LT:()=>$,iH:()=>Q,W0:()=>j,DO:()=>W});const i=(P={array:()=>e.array,createCheckers:()=>e.createCheckers,iface:()=>e.iface,indexKey:()=>e.indexKey,opt:()=>e.opt},R={},r.d(R,P),R),o={Channel:(0,i.iface)([],{displayName:(0,i.opt)("string"),functionID:(0,i.opt)("string"),room:(0,i.opt)("string"),floor:(0,i.opt)("string"),inputs:(0,i.opt)((0,i.iface)([],{[i.indexKey]:"InOutPut"})),outputs:(0,i.opt)((0,i.iface)([],{[i.indexKey]:"InOutPut"})),type:(0,i.opt)("string")})},s={Configuration:(0,i.iface)([],{[i.indexKey]:"SysAP"})},a={Device:(0,i.iface)([],{displayName:(0,i.opt)("string"),room:(0,i.opt)("string"),floor:(0,i.opt)("string"),interface:(0,i.opt)("string"),nativeId:(0,i.opt)("string"),channels:(0,i.opt)((0,i.iface)([],{[i.indexKey]:"Channel"}))})},c={DeviceList:(0,i.iface)([],{[i.indexKey]:(0,i.array)("string")})},u={DeviceResponse:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{devices:"Devices"})})},l={Devices:(0,i.iface)([],{[i.indexKey]:"Device"})},f={Error:(0,i.iface)([],{code:"string",detail:"string",title:"string"})},p={Floors:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{name:"string",rooms:"Rooms"})})},h={GetDataPointResponse:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{values:(0,i.array)("string")})})},d={InOutPut:(0,i.iface)([],{value:(0,i.opt)("string"),pairingID:(0,i.opt)("number")})},y={Rooms:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{name:"string"})})},v={ScenesTriggered:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{channels:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{outputs:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{value:"string",pairingID:"number"})})})})})})},b={SetDataPointResponse:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{[i.indexKey]:"string"})})},g={SysAP:(0,i.iface)([],{devices:"Devices",floorplan:(0,i.iface)([],{floors:"Floors"}),sysapName:"string",users:"Users",error:(0,i.opt)("Error")})},S={Users:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{enabled:"boolean",flags:(0,i.array)("string"),grantedPermissions:(0,i.array)("string"),jid:"string",name:"string",requestedPermissions:(0,i.array)("string"),role:"string"})})},m={VirtualDeviceResponse:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{devices:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{serial:"string"})})})})},w={WebSocketMessage:(0,i.iface)([],{[i.indexKey]:(0,i.iface)([],{datapoints:(0,i.iface)([],{[i.indexKey]:"string"}),devices:(0,i.iface)([],{[i.indexKey]:"Devices"}),devicesAdded:(0,i.array)("string"),devicesRemoved:(0,i.array)("string"),scenesTriggered:"ScenesTriggered"})})},{Configuration:x}=(0,i.createCheckers)(s,l,a,o,d,p,y,g,S,f),{DeviceList:A}=(0,i.createCheckers)(c),{DeviceResponse:E}=(0,i.createCheckers)(u,l,a,o,d),{GetDataPointResponse:_}=(0,i.createCheckers)(h),{SetDataPointResponse:O}=(0,i.createCheckers)(b),{VirtualDeviceResponse:k}=(0,i.createCheckers)(m),{WebSocketMessage:D}=(0,i.createCheckers)(w,l,a,o,d,v);var P,R,T;function C(e,t,r){if(r)try{return t.check(e),!0}catch(e){return console.error("Object validation failed!",e),!1}return t.test(e)}function W(e,t=!1){return C(e,D,t)}function K(e,t=!1){return C(e,x,t)}function M(e,t=!1){return C(e,A,t)}function $(e,t=!1){return C(e,E,t)}function Q(e,t=!1){return C(e,_,t)}function j(e,t=!1){return C(e,O,t)}function B(e,t=!1){return C(e,k,t)}!function(e){e.BinarySensor="BinarySensor",e.BlindActuator="BlindActuator",e.SwitchingActuator="SwitchingActuator",e.CeilingFanActuator="CeilingFanActuator",e.RTC="RTC",e.DimActuator="DimActuator",e.EVCharging="evcharging",e.WindowSensor="WindowSensor",e.SimpleDoorlock="simple_doorlock",e.ShutterActuator="ShutterActuator",e.WeatherStation="WeatherStation",e.WeatherTemperatureSensor="Weather-TemperatureSensor",e.WeatherWindSensor="Weather-WindSensor",e.WeatherBrightnessSensor="Weather-BrightnessSensor",e.WeatherRainSensor="Weather-RainSensor",e.WindowActuator="WindowActuator",e.CODetector="CODetector",e.FireDetector="FireDetector",e.KNXSwitchSensor="KNX-SwitchSensor",e.MediaPlayer="MediaPlayer",e.EnergyBattery="EnergyBattery",e.EnergyInverter="EnergyInverter",e.EnergyMeter="EnergyMeter",e.EnergyInverterBattery="EnergyInverterBattery",e.EnergyInverterMeter="EnergyInverterMeter",e.EnergyInverterMeterBattery="EnergyInverterMeterBattery",e.EnergyMeterBattery="EnergyMeterBattery",e.AirQualityCO2="AirQualityCO2",e.AirQualityCO="AirQualityCO",e.AirQualityFull="AirQualityFull",e.AirQualityHumidity="AirQualityHumidity",e.AirQualityNO2="AirQualityNO2",e.AirQualityO3="AirQualityO3",e.AirQualityPM10="AirQualityPM10",e.AirQualityPM25="AirQualityPM25",e.AirQualityPressure="AirQualityPressure",e.AirQualityTemperature="AirQualityTemperature",e.AirQualityVOC="AirQualityVOC"}(T||(T={}));var I=function(e,t){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},I(e,t)};function N(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function V(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function L(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function z(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function F(e){return"function"==typeof e}function U(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Object.create,Object.create;var G=U((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function H(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var q=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=V(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(F(c))try{c()}catch(e){i=e instanceof G?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=V(u),f=l.next();!f.done;f=l.next()){var p=f.value;try{Y(p)}catch(e){i=null!=i?i:[],e instanceof G?i=z(z([],L(i)),L(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new G(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Y(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&H(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&H(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),J=q.EMPTY;function X(e){return e instanceof q||e&&"closed"in e&&F(e.remove)&&F(e.add)&&F(e.unsubscribe)}function Y(e){F(e)?e():e.unsubscribe()}var Z=null,ee=null,te=void 0,re=!1,ne=!1,ie={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ie.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,z([e,t],L(r))):setTimeout.apply(void 0,z([e,t],L(r)))},clearTimeout:function(e){var t=ie.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function oe(){}var se=ae("C",void 0,void 0);function ae(e,t,r){return{kind:e,value:t,error:r}}var ce=null;function ue(e){if(re){var t=!ce;if(t&&(ce={errorThrown:!1,error:null}),e(),t){var r=ce,n=r.errorThrown,i=r.error;if(ce=null,n)throw i}}else e()}var le=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,X(t)&&t.add(r)):r.destination=be,r}return N(t,e),t.create=function(e,t,r){return new de(e,t,r)},t.prototype.next=function(e){this.isStopped?ve(function(e){return ae("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ve(ae("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ve(se,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(q),fe=Function.prototype.bind;function pe(e,t){return fe.call(e,t)}var he=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){ye(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ye(e)}else ye(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ye(e)}},e}(),de=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;return F(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&ne?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&pe(t.next,o),error:t.error&&pe(t.error,o),complete:t.complete&&pe(t.complete,o)}):i=t,s.destination=new he(i),s}return N(t,e),t}(le);function ye(e){var t;re?(t=e,re&&ce&&(ce.errorThrown=!0,ce.error=t)):function(e){ie.setTimeout((function(){if(!Z)throw e;Z(e)}))}(e)}function ve(e,t){var r=ee;r&&ie.setTimeout((function(){return r(e,t)}))}var be={closed:!0,next:oe,error:function(e){throw e},complete:oe},ge="function"==typeof Symbol&&Symbol.observable||"@@observable";function Se(e){return e}function me(e){return 0===e.length?Se:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var we=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof le||function(e){return e&&F(e.next)&&F(e.error)&&F(e.complete)}(n)&&X(n)?e:new de(e,t,r);return ue((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=xe(t))((function(t,n){var i=new de({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[ge]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return me(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=xe(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function xe(e){var t;return null!==(t=null!=e?e:te)&&void 0!==t?t:Promise}var Ae=U((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ee=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return N(t,e),t.prototype.lift=function(e){var t=new _e(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ae},t.prototype.next=function(e){var t=this;ue((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=V(t.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;ue((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;ue((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?J:(this.currentObservers=null,o.push(e),new q((function(){t.currentObservers=null,H(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new we;return e.source=this,e},t.create=function(e,t){return new _e(e,t)},t}(we),_e=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return N(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:J},t}(Ee);const Oe=(e=>{var t={};return r.d(t,e),t})({WebSocket:()=>t.WebSocket});var ke=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};class De{constructor(e,t,r,n=!0,i=!1){this.webSocketMessageSubject=new Ee,this.basicAuthKey=Buffer.from(`${t}:${r}`,"utf8").toString("base64"),this.hostName=e,this.tlsEnabled=n,this.verboseErrors=i}connectWebSocket(e=!0){if(this.webSocket&&this.webSocket.readyState===Oe.WebSocket.OPEN)throw new Error("Web socket is already connected");this.webSocket=this.createWebSocket(e)}createVirtualDevice(e,t,r){return ke(this,void 0,void 0,(function*(){const n=yield this.fetchDataViaRest("PUT",`virtualdevice/${e}/${t}`,JSON.stringify(r));return yield this.processRestResponse(n,B)}))}createWebSocket(e){this.tlsEnabled&&!e&&console.warn("TLS certificate verification is disabled! This poses a security risk, activating certificate verification is strictly recommended.");const t=`${this.tlsEnabled?"wss":"ws"}://${this.hostName}/fhapi/v1/api/ws`,r={rejectUnauthorized:this.tlsEnabled&&e,headers:{Authorization:`Basic ${this.basicAuthKey}`}},n=new Oe.WebSocket(t,r);return n.on("error",(e=>console.error("Error received",e))),n.on("ping",(e=>console.debug("Ping received",e.toString("ascii")))),n.on("pong",(e=>console.debug("Pong received",e.toString("ascii")))),n.on("unexpected-response",(()=>console.error("Unexpected response received"))),n.on("upgrade",(()=>console.debug("Upgrade request received"))),n.on("open",(()=>console.log("Connection opened"))),n.on("close",(()=>console.log("Connection closed"))),n.on("message",((e,t)=>this.processWebSocketMessage(e,t))),n}disconnectWebSocket(e=!1){if(!this.webSocket||this.webSocket.readyState===Oe.WebSocket.CLOSED)throw new Error("Web socket is not open");e?this.webSocket.terminate():this.webSocket.close()}getConfiguration(){return ke(this,void 0,void 0,(function*(){const e=yield this.fetchDataViaRest("GET","configuration");return yield this.processRestResponse(e,K)}))}getDeviceList(){return ke(this,void 0,void 0,(function*(){const e=yield this.fetchDataViaRest("GET","devicelist");return yield this.processRestResponse(e,M)}))}getDevice(e,t){return ke(this,void 0,void 0,(function*(){const r=yield this.fetchDataViaRest("GET",`device/${e}/${t}`);return yield this.processRestResponse(r,$)}))}getDatapoint(e,t,r,n){return ke(this,void 0,void 0,(function*(){const i=yield this.fetchDataViaRest("GET",`datapoint/${e}/${t}.${r}.${n}`);return yield this.processRestResponse(i,Q)}))}getWebSocketMessages(){return this.webSocketMessageSubject.asObservable()}setDatapoint(e,t,r,n,i){return ke(this,void 0,void 0,(function*(){const o=yield this.fetchDataViaRest("PUT",`datapoint/${e}/${t}.${r}.${n}`,i);return yield this.processRestResponse(o,j)}))}fetchDataViaRest(e,t,r){return ke(this,void 0,void 0,(function*(){const n=`${this.tlsEnabled?"https":"http"}://${this.hostName}/fhapi/v1/api/rest/${t}`,i={method:e,headers:{Authorization:`Basic ${this.basicAuthKey}`},body:r};return yield fetch(n,i)}))}processRestResponse(e,t){return ke(this,void 0,void 0,(function*(){let r,n;switch(e.status){case 200:if(r=yield e.json(),!t(r,this.verboseErrors))throw n="Received message has an unexpected type!",console.error(n,r),new Error(n);return r;case 401:throw n="Authentication information is missing or invalid.",console.error(n),new Error(n);case 502:throw n=yield e.text(),console.error(n),new Error(n);default:throw n=`Received HTTP ${e.status} status code unexpectedly: ${yield e.text()}`,console.error(n),new Error(n)}}))}processWebSocketMessage(e,t){if(t)return void console.warn("Binary message received. Binary messages are not processed.");console.debug("Message received");const r=e.toString(),n=JSON.parse(r);W(n,this.verboseErrors)?this.webSocketMessageSubject.next(n):console.error("Received message has an unexpected type!",r)}}var Pe=n.ns,Re=n.LB,Te=n.s,Ce=n.L$,We=n.LT,Ke=n.iH,Me=n.W0,$e=n.DO;export{Pe as SystemAccessPoint,Re as VirtualDeviceType,Te as isConfiguration,Ce as isDeviceList,We as isDeviceResponse,Ke as isGetDataPointResponse,Me as isSetDataPointResponse,$e as isWebSocketMessage};
|
|
2
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","mappings":"4DACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,sFCElF,MAAM,GAFEI,EAE+B,CAAE,MAAW,IAAMC,EAA0DC,MAAO,eAAoB,IAAMD,EAA0DE,eAAgB,MAAW,IAAMF,EAA0DG,MAAO,SAAc,IAAMH,EAA0DI,SAAU,IAAS,IAAMJ,EAA0DK,KAF/bC,EAAI,GAAIrB,EAAoBsB,EAAED,EAAGP,GAAWO,GCoBlDE,EAA+B,CAC1CC,SAnBc,IAAAN,OAAM,GAAI,CACxBO,aAAa,IAAAL,KAAI,UACjBM,YAAY,IAAAN,KAAI,UAChBO,MAAM,IAAAP,KAAI,UACVQ,OAAO,IAAAR,KAAI,UACXS,QAAQ,IAAAT,MACN,IAAAF,OAAM,GAAI,CACR,CAAC,EAAAC,UAAW,cAGhBW,SAAS,IAAAV,MACP,IAAAF,OAAM,GAAI,CACR,CAAC,EAAAC,UAAW,cAGhBY,MAAM,IAAAX,KAAI,aCXCY,EAAqC,CAChDC,eALoB,IAAAf,OAAM,G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AAM0B,EAAa3B,EAAKhK,WAClBH,EAAmByJ,KAAKsC,MAAMD,GAEhClP,EAAmBoD,EAASnC,KAAK6K,eACnC7K,KAAK8K,wBAAwBpK,KAAKyB,GAIpCtD,QAAQtB,MAAM,2CAA4C0Q,I","sources":["webpack://freeathome-local-api-client/webpack/bootstrap","webpack://freeathome-local-api-client/webpack/runtime/define property getters","webpack://freeathome-local-api-client/webpack/runtime/hasOwnProperty shorthand","webpack://freeathome-local-api-client/external module \"ts-interface-checker\"","webpack://freeathome-local-api-client/./src/model/validation/channel-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/configuration-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/device-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/device-list-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/device-response-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/devices-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/error-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/floors-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/get-data-point-response-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/in-out-put-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/rooms-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/scenes-triggered-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/set-data-point-response-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/sys-ap-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/users-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/virtual-device-response-ti.ts","webpack://freeathome-local-api-client/./src/model/validation/websocket-message-ti.ts","webpack://freeathome-local-api-client/./src/model/validator.ts","webpack://freeathome-local-api-client/./src/model/virtual-device.ts","webpack://freeathome-local-api-client/./node_modules/tslib/tslib.es6.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/isFunction.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/Subscription.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/config.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/noop.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/NotificationFactories.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/errorContext.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/Subscriber.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/symbol/observable.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/identity.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/pipe.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/Observable.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","webpack://freeathome-local-api-client/./node_modules/rxjs/dist/esm5/internal/Subject.js","webpack://freeathome-local-api-client/external module \"ws\"","webpack://freeathome-local-api-client/./src/system-access-point.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"array\"]: () => __WEBPACK_EXTERNAL_MODULE_ts_interface_checker_865cda28__.array, [\"createCheckers\"]: () => __WEBPACK_EXTERNAL_MODULE_ts_interface_checker_865cda28__.createCheckers, [\"iface\"]: () => __WEBPACK_EXTERNAL_MODULE_ts_interface_checker_865cda28__.iface, [\"indexKey\"]: () => __WEBPACK_EXTERNAL_MODULE_ts_interface_checker_865cda28__.indexKey, [\"opt\"]: () => __WEBPACK_EXTERNAL_MODULE_ts_interface_checker_865cda28__.opt });","import { ITypeSuite, iface, indexKey, opt } from \"ts-interface-checker\";\r\n\r\nconst Channel = iface([], {\r\n displayName: opt(\"string\"),\r\n functionID: opt(\"string\"),\r\n room: opt(\"string\"),\r\n floor: opt(\"string\"),\r\n inputs: opt(\r\n iface([], {\r\n [indexKey]: \"InOutPut\",\r\n })\r\n ),\r\n outputs: opt(\r\n iface([], {\r\n [indexKey]: \"InOutPut\",\r\n })\r\n ),\r\n type: opt(\"string\"),\r\n});\r\n\r\nexport const ChannelTypeSuite: ITypeSuite = {\r\n Channel,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Configuration = iface([], {\r\n [indexKey]: \"SysAP\",\r\n});\r\n\r\nexport const ConfigurationTypeSuite: ITypeSuite = {\r\n Configuration,\r\n};\r\n","import { iface, indexKey, opt, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Device = iface([], {\r\n displayName: opt(\"string\"),\r\n room: opt(\"string\"),\r\n floor: opt(\"string\"),\r\n interface: opt(\"string\"),\r\n nativeId: opt(\"string\"),\r\n channels: opt(\r\n iface([], {\r\n [indexKey]: \"Channel\",\r\n })\r\n ),\r\n});\r\n\r\nexport const DeviceTypeSuite: ITypeSuite = {\r\n Device,\r\n};\r\n","import { array, iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst DeviceList = iface([], {\r\n [indexKey]: array(\"string\"),\r\n});\r\n\r\nexport const DeviceListTypeSuite: ITypeSuite = {\r\n DeviceList,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst DeviceResponse = iface([], {\r\n [indexKey]: iface([], {\r\n devices: \"Devices\",\r\n }),\r\n});\r\n\r\nexport const DeviceResponseTypeSuite: ITypeSuite = {\r\n DeviceResponse,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Devices = iface([], {\r\n [indexKey]: \"Device\",\r\n});\r\n\r\nexport const DevicesTypeSuite: ITypeSuite = {\r\n Devices,\r\n};\r\n","import { iface, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Error = iface([], {\r\n code: \"string\",\r\n detail: \"string\",\r\n title: \"string\",\r\n});\r\n\r\nexport const ErrorTypeSuite: ITypeSuite = {\r\n Error,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Floors = iface([], {\r\n [indexKey]: iface([], {\r\n name: \"string\",\r\n rooms: \"Rooms\",\r\n }),\r\n});\r\n\r\nexport const FloorsTypeSuite: ITypeSuite = {\r\n Floors,\r\n};\r\n","import { array, iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst GetDataPointResponse = iface([], {\r\n [indexKey]: iface([], {\r\n values: array(\"string\"),\r\n }),\r\n});\r\n\r\nexport const GetDataPointResponseTypeSuite: ITypeSuite = {\r\n GetDataPointResponse,\r\n};\r\n","import { iface, opt, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst InOutPut = iface([], {\r\n value: opt(\"string\"),\r\n pairingID: opt(\"number\"),\r\n});\r\n\r\nexport const InOutPutTypeSuite: ITypeSuite = {\r\n InOutPut,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Rooms = iface([], {\r\n [indexKey]: iface([], {\r\n name: \"string\",\r\n }),\r\n});\r\n\r\nexport const RoomsTypeSuite: ITypeSuite = {\r\n Rooms,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst ScenesTriggered = iface([], {\r\n [indexKey]: iface([], {\r\n channels: iface([], {\r\n [indexKey]: iface([], {\r\n outputs: iface([], {\r\n [indexKey]: iface([], {\r\n value: \"string\",\r\n pairingID: \"number\",\r\n }),\r\n }),\r\n }),\r\n }),\r\n }),\r\n});\r\n\r\nexport const ScenesTriggeredTypeSuite: ITypeSuite = {\r\n ScenesTriggered,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst SetDataPointResponse = iface([], {\r\n [indexKey]: iface([], {\r\n [indexKey]: \"string\",\r\n }),\r\n});\r\n\r\nexport const SetDataPointResponseTypeSuite: ITypeSuite = {\r\n SetDataPointResponse,\r\n};\r\n","import { iface, opt, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst SysAP = iface([], {\r\n devices: \"Devices\",\r\n floorplan: iface([], {\r\n floors: \"Floors\",\r\n }),\r\n sysapName: \"string\",\r\n users: \"Users\",\r\n error: opt(\"Error\"),\r\n});\r\n\r\nexport const SysApTypeSuite: ITypeSuite = {\r\n SysAP,\r\n};\r\n","import { array, iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst Users = iface([], {\r\n [indexKey]: iface([], {\r\n enabled: \"boolean\",\r\n flags: array(\"string\"),\r\n grantedPermissions: array(\"string\"),\r\n jid: \"string\",\r\n name: \"string\",\r\n requestedPermissions: array(\"string\"),\r\n role: \"string\",\r\n }),\r\n});\r\n\r\nexport const UsersTypeSuite: ITypeSuite = {\r\n Users,\r\n};\r\n","import { iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst VirtualDeviceResponse = iface([], {\r\n [indexKey]: iface([], {\r\n devices: iface([], {\r\n [indexKey]: iface([], {\r\n serial: \"string\",\r\n }),\r\n }),\r\n }),\r\n});\r\n\r\nexport const VirtualDeviceResponseTypeSuite: ITypeSuite = {\r\n VirtualDeviceResponse,\r\n};\r\n","import { array, iface, indexKey, ITypeSuite } from \"ts-interface-checker\";\r\n\r\nconst WebSocketMessage = iface([], {\r\n [indexKey]: iface([], {\r\n datapoints: iface([], {\r\n [indexKey]: \"string\",\r\n }),\r\n devices: iface([], {\r\n [indexKey]: \"Devices\",\r\n }),\r\n devicesAdded: array(\"string\"),\r\n devicesRemoved: array(\"string\"),\r\n scenesTriggered: \"ScenesTriggered\",\r\n }),\r\n});\r\n\r\nexport const WebSocketMessageTypeSuite: ITypeSuite = {\r\n WebSocketMessage,\r\n};\r\n","import {\r\n ChannelTypeSuite,\r\n DeviceTypeSuite,\r\n DevicesTypeSuite,\r\n InOutPutTypeSuite,\r\n ScenesTriggeredTypeSuite,\r\n WebSocketMessageTypeSuite,\r\n DeviceListTypeSuite,\r\n SetDataPointResponseTypeSuite,\r\n GetDataPointResponseTypeSuite,\r\n ConfigurationTypeSuite,\r\n FloorsTypeSuite,\r\n RoomsTypeSuite,\r\n SysApTypeSuite,\r\n UsersTypeSuite,\r\n ErrorTypeSuite,\r\n DeviceResponseTypeSuite,\r\n VirtualDeviceResponseTypeSuite,\r\n} from \"./validation\";\r\nimport { Checker, createCheckers } from \"ts-interface-checker\";\r\nimport { WebSocketMessage as Message } from \"./websocket-message\";\r\nimport { Configuration as Config } from \"./configuration\";\r\nimport { DeviceList as DevList } from \"./device-list\";\r\nimport { DeviceResponse as DevResponse } from \"./device-response\";\r\nimport { GetDataPointResponse as GetResponse } from \"./get-data-point-response\";\r\nimport { SetDataPointResponse as SetResponse } from \"./set-data-point-response\";\r\nimport { VirtualDeviceResponse as VDeviceResponse } from \"./virtual-device-response\";\r\n\r\nconst { Configuration } = createCheckers(\r\n ConfigurationTypeSuite,\r\n DevicesTypeSuite,\r\n DeviceTypeSuite,\r\n ChannelTypeSuite,\r\n InOutPutTypeSuite,\r\n FloorsTypeSuite,\r\n RoomsTypeSuite,\r\n SysApTypeSuite,\r\n UsersTypeSuite,\r\n ErrorTypeSuite\r\n);\r\n\r\nconst { DeviceList } = createCheckers(DeviceListTypeSuite);\r\n\r\nconst { DeviceResponse } = createCheckers(\r\n DeviceResponseTypeSuite,\r\n DevicesTypeSuite,\r\n DeviceTypeSuite,\r\n ChannelTypeSuite,\r\n InOutPutTypeSuite\r\n);\r\n\r\nconst { GetDataPointResponse } = createCheckers(GetDataPointResponseTypeSuite);\r\n\r\nconst { SetDataPointResponse } = createCheckers(SetDataPointResponseTypeSuite);\r\n\r\nconst { VirtualDeviceResponse } = createCheckers(\r\n VirtualDeviceResponseTypeSuite\r\n);\r\n\r\nconst { WebSocketMessage } = createCheckers(\r\n WebSocketMessageTypeSuite,\r\n DevicesTypeSuite,\r\n DeviceTypeSuite,\r\n ChannelTypeSuite,\r\n InOutPutTypeSuite,\r\n ScenesTriggeredTypeSuite\r\n);\r\n\r\nfunction check(obj: unknown, checker: Checker, verbose: boolean): boolean {\r\n if (verbose) {\r\n try {\r\n checker.check(obj);\r\n return true;\r\n } catch (error) {\r\n console.error(\"Object validation failed!\", error);\r\n return false;\r\n }\r\n }\r\n\r\n return checker.test(obj);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a web socket message.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see Message.\r\n */\r\nexport function isWebSocketMessage(\r\n obj: unknown,\r\n verbose = false\r\n): obj is Message {\r\n return check(obj, WebSocketMessage, verbose);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a configuration.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see Config.\r\n */\r\nexport function isConfiguration(obj: unknown, verbose = false): obj is Config {\r\n return check(obj, Configuration, verbose);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a device list.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see DevList.\r\n */\r\nexport function isDeviceList(obj: unknown, verbose = false): obj is DevList {\r\n return check(obj, DeviceList, verbose);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a device response.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see DevResponse.\r\n */\r\nexport function isDeviceResponse(\r\n obj: unknown,\r\n verbose = false\r\n): obj is DevResponse {\r\n return check(obj, DeviceResponse, verbose);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a valid response to a get data point request.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see GetResponse.\r\n */\r\nexport function isGetDataPointResponse(\r\n obj: unknown,\r\n verbose = false\r\n): obj is GetResponse {\r\n return check(obj, GetDataPointResponse, verbose);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a valid response to a set data point request.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see SetResponse.\r\n */\r\nexport function isSetDataPointResponse(\r\n obj: unknown,\r\n verbose = false\r\n): obj is SetResponse {\r\n return check(obj, SetDataPointResponse, verbose);\r\n}\r\n\r\n/**\r\n * Determines whether the specified object is a virtual device response.\r\n * @param obj The object to be tested\r\n * @param verbose Determines whether validation errors shall be logged. Default value is false.\r\n * @returns A boolean value indicating whether the specified object is a @see VDeviceResponse.\r\n */\r\nexport function isVirtualDeviceResponse(\r\n obj: unknown,\r\n verbose = false\r\n): obj is VDeviceResponse {\r\n return check(obj, VirtualDeviceResponse, verbose);\r\n}\r\n","/**\r\n * Defines a virtual device\r\n *\r\n * @interface\r\n */\r\nexport interface VirtualDevice {\r\n type: VirtualDeviceType;\r\n properties?: {\r\n ttl?: string;\r\n displayname?: string;\r\n };\r\n}\r\n\r\n/**\r\n * Defines the possible types of virtual devices\r\n *\r\n * @enum\r\n */\r\nexport enum VirtualDeviceType {\r\n BinarySensor = \"BinarySensor\",\r\n BlindActuator = \"BlindActuator\",\r\n SwitchingActuator = \"SwitchingActuator\",\r\n CeilingFanActuator = \"CeilingFanActuator\",\r\n RTC = \"RTC\",\r\n DimActuator = \"DimActuator\",\r\n EVCharging = \"evcharging\",\r\n WindowSensor = \"WindowSensor\",\r\n SimpleDoorlock = \"simple_doorlock\",\r\n ShutterActuator = \"ShutterActuator\",\r\n WeatherStation = \"WeatherStation\",\r\n WeatherTemperatureSensor = \"Weather-TemperatureSensor\",\r\n WeatherWindSensor = \"Weather-WindSensor\",\r\n WeatherBrightnessSensor = \"Weather-BrightnessSensor\",\r\n WeatherRainSensor = \"Weather-RainSensor\",\r\n WindowActuator = \"WindowActuator\",\r\n CODetector = \"CODetector\",\r\n FireDetector = \"FireDetector\",\r\n KNXSwitchSensor = \"KNX-SwitchSensor\",\r\n MediaPlayer = \"MediaPlayer\",\r\n EnergyBattery = \"EnergyBattery\",\r\n EnergyInverter = \"EnergyInverter\",\r\n EnergyMeter = \"EnergyMeter\",\r\n EnergyInverterBattery = \"EnergyInverterBattery\",\r\n EnergyInverterMeter = \"EnergyInverterMeter\",\r\n EnergyInverterMeterBattery = \"EnergyInverterMeterBattery\",\r\n EnergyMeterBattery = \"EnergyMeterBattery\",\r\n AirQualityCO2 = \"AirQualityCO2\",\r\n AirQualityCO = \"AirQualityCO\",\r\n AirQualityFull = \"AirQualityFull\",\r\n AirQualityHumidity = \"AirQualityHumidity\",\r\n AirQualityNO2 = \"AirQualityNO2\",\r\n AirQualityO3 = \"AirQualityO3\",\r\n AirQualityPM10 = \"AirQualityPM10\",\r\n AirQualityPM25 = \"AirQualityPM25\",\r\n AirQualityPressure = \"AirQualityPressure\",\r\n AirQualityTemperature = \"AirQualityTemperature\",\r\n AirQualityVOC = \"AirQualityVOC\",\r\n}\r\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind: kind,\n value: value,\n error: error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"WebSocket\"]: () => __WEBPACK_EXTERNAL_MODULE_ws__.WebSocket });","import { Observable, Subject } from \"rxjs\";\r\nimport { ClientOptions, RawData, WebSocket } from \"ws\";\r\nimport {\r\n Configuration,\r\n DeviceList,\r\n DeviceResponse,\r\n GetDataPointResponse,\r\n isDeviceList,\r\n isDeviceResponse,\r\n isWebSocketMessage,\r\n isGetDataPointResponse,\r\n isSetDataPointResponse,\r\n isConfiguration,\r\n SetDataPointResponse,\r\n WebSocketMessage,\r\n VirtualDevice,\r\n VirtualDeviceResponse,\r\n} from \"./model\";\r\nimport { isVirtualDeviceResponse } from \"./model/validator\";\r\n\r\ntype HttpRequestMethod = \"GET\" | \"POST\" | \"DELETE\" | \"PATCH\" | \"PUT\";\r\n\r\n/**\r\n * The class representing a System Access Point.\r\n *\r\n * @class\r\n */\r\nexport class SystemAccessPoint {\r\n /** The basic authentication key used for requests. */\r\n public readonly basicAuthKey: string;\r\n /** The host name of the system access point. */\r\n public readonly hostName: string;\r\n /** Determines whether requests to the system access point will use TLS. */\r\n public readonly tlsEnabled: boolean;\r\n private verboseErrors: boolean;\r\n private webSocket?: WebSocket;\r\n private readonly webSocketMessageSubject = new Subject<WebSocketMessage>();\r\n\r\n /**\r\n * Constructs a new SystemAccessPoint instance\r\n *\r\n * @constructor\r\n * @param hostName The system access point host name.\r\n * @param userName The user name that shall be used to authenticate with the system access point.\r\n * @param password The password that shall be used to authenticate with the system access point.\r\n * @param tlsEnabled Determines whether the communication with the system access point shall be protected by TLS. Defaults to true\r\n * @param verboseErrors Determines whether verbose error messages shall be used, for example for message validation. Defaults to false.\r\n */\r\n constructor(\r\n hostName: string,\r\n userName: string,\r\n password: string,\r\n tlsEnabled = true,\r\n verboseErrors = false\r\n ) {\r\n // Create Basic Authentication key\r\n this.basicAuthKey = Buffer.from(`${userName}:${password}`, \"utf8\").toString(\r\n \"base64\"\r\n );\r\n this.hostName = hostName;\r\n this.tlsEnabled = tlsEnabled;\r\n this.verboseErrors = verboseErrors;\r\n }\r\n\r\n /**\r\n * Connects to the System Access Point web socket.\r\n *\r\n * @function\r\n * @param certificateVerification Determines whether the TLS certificate presented by the server will be verified.\r\n */\r\n public connectWebSocket(certificateVerification = true): void {\r\n if (this.webSocket && this.webSocket.readyState === WebSocket.OPEN) {\r\n throw new Error(\"Web socket is already connected\");\r\n }\r\n\r\n this.webSocket = this.createWebSocket(certificateVerification);\r\n }\r\n\r\n /**\r\n * Creates a new virtual device.\r\n * @param sysApUuid The UUID identifying the system access point\r\n * @param deviceSerial The serial number to be assigned to the device.\r\n * @param virtualDevice The virtual device to be created.\r\n */\r\n public async createVirtualDevice(\r\n sysApUuid: string,\r\n deviceSerial: string,\r\n virtualDevice: VirtualDevice\r\n ): Promise<VirtualDeviceResponse> {\r\n // Get response from system access point\r\n const response: Response = await this.fetchDataViaRest(\r\n \"PUT\",\r\n `virtualdevice/${sysApUuid}/${deviceSerial}`,\r\n JSON.stringify(virtualDevice)\r\n );\r\n\r\n // Process response\r\n return await this.processRestResponse(response, isVirtualDeviceResponse);\r\n }\r\n\r\n private createWebSocket(certificateVerification: boolean): WebSocket {\r\n // Disabling certificate verification is discouraged, issue a warning\r\n if (this.tlsEnabled && !certificateVerification) {\r\n console.warn(\r\n \"TLS certificate verification is disabled! This poses a security risk, activating certificate verification is strictly recommended.\"\r\n );\r\n }\r\n\r\n const url = `${this.tlsEnabled ? \"wss\" : \"ws\"}://${\r\n this.hostName\r\n }/fhapi/v1/api/ws`;\r\n const options: ClientOptions = {\r\n rejectUnauthorized: this.tlsEnabled && certificateVerification,\r\n headers: {\r\n Authorization: `Basic ${this.basicAuthKey}`,\r\n },\r\n };\r\n const webSocket = new WebSocket(url, options);\r\n webSocket.on(\"error\", (error: Error) =>\r\n console.error(\"Error received\", error)\r\n );\r\n webSocket.on(\"ping\", (data: Buffer) =>\r\n console.debug(\"Ping received\", data.toString(\"ascii\"))\r\n );\r\n webSocket.on(\"pong\", (data: Buffer) =>\r\n console.debug(\"Pong received\", data.toString(\"ascii\"))\r\n );\r\n webSocket.on(\"unexpected-response\", () =>\r\n console.error(\"Unexpected response received\")\r\n );\r\n webSocket.on(\"upgrade\", () => console.debug(\"Upgrade request received\"));\r\n webSocket.on(\"open\", () => console.log(\"Connection opened\"));\r\n webSocket.on(\"close\", () => console.log(\"Connection closed\"));\r\n webSocket.on(\"message\", (data: RawData, isBinary: boolean) =>\r\n this.processWebSocketMessage(data, isBinary)\r\n );\r\n return webSocket;\r\n }\r\n\r\n /**\r\n * Disconnects from the System Access Point web socket.\r\n *\r\n * @function\r\n * @param force Determines whether or not the connection will be closed forcibly\r\n */\r\n public disconnectWebSocket(force = false): void {\r\n if (!this.webSocket || this.webSocket.readyState === WebSocket.CLOSED) {\r\n throw new Error(\"Web socket is not open\");\r\n }\r\n\r\n if (force) {\r\n this.webSocket.terminate();\r\n } else {\r\n this.webSocket.close();\r\n }\r\n }\r\n\r\n /**\r\n * Gets the configuration from the system access point\r\n * @returns The @see Configuration\r\n */\r\n public async getConfiguration(): Promise<Configuration> {\r\n // Get response from system access point\r\n const response: Response = await this.fetchDataViaRest(\r\n \"GET\",\r\n \"configuration\"\r\n );\r\n\r\n // Process response\r\n return await this.processRestResponse(response, isConfiguration);\r\n }\r\n\r\n /**\r\n * Gets the device list from the system access point.\r\n * @returns The @see DeviceList\r\n */\r\n public async getDeviceList(): Promise<DeviceList> {\r\n // Get response from system access point\r\n const response: Response = await this.fetchDataViaRest(\"GET\", \"devicelist\");\r\n\r\n // Process response\r\n return await this.processRestResponse(response, isDeviceList);\r\n }\r\n\r\n /**\r\n * Gets the specified device from the system access point\r\n * @param sysApUuid The UUID identifying the system access point\r\n * @param deviceSerial The device serial number\r\n */\r\n public async getDevice(\r\n sysApUuid: string,\r\n deviceSerial: string\r\n ): Promise<DeviceResponse> {\r\n // Get response from system access point\r\n const response: Response = await this.fetchDataViaRest(\r\n \"GET\",\r\n `device/${sysApUuid}/${deviceSerial}`\r\n );\r\n\r\n // Process response\r\n return await this.processRestResponse(response, isDeviceResponse);\r\n }\r\n\r\n /**\r\n * Gets the specified data point from the system access point.\r\n * @param sysApUuid The UUID idenfifying the system access point\r\n * @param deviceSerial The device serial number\r\n * @param channel The channel identifier\r\n * @param dataPoint The datapoint identifier\r\n * @returns The requested @see GetDataPointResponse\r\n */\r\n public async getDatapoint(\r\n sysApUuid: string,\r\n deviceSerial: string,\r\n channel: string,\r\n dataPoint: string\r\n ): Promise<GetDataPointResponse> {\r\n // Get response from system access point\r\n const response: Response = await this.fetchDataViaRest(\r\n \"GET\",\r\n `datapoint/${sysApUuid}/${deviceSerial}.${channel}.${dataPoint}`\r\n );\r\n\r\n // Process response\r\n return await this.processRestResponse(response, isGetDataPointResponse);\r\n }\r\n\r\n /**\r\n * Gets the web socket messages.\r\n *\r\n * @returns An observable that is updated with the messages received from the web socket.\r\n */\r\n public getWebSocketMessages(): Observable<WebSocketMessage> {\r\n return this.webSocketMessageSubject.asObservable();\r\n }\r\n /**\r\n * Sets a new value for the specificed data point.\r\n * @param sysApUuid The UUID idenfifying the system access point\r\n * @param deviceSerial The device serial number\r\n * @param channel The channel identifier\r\n * @param dataPoint The datapoint identifier\r\n * @param value The new value to be set\r\n * @returns A @see SetDataPointResponse describing the result of the operation\r\n */\r\n public async setDatapoint(\r\n sysApUuid: string,\r\n deviceSerial: string,\r\n channel: string,\r\n dataPoint: string,\r\n value: string\r\n ): Promise<SetDataPointResponse> {\r\n // Get response from system access point\r\n const response: Response = await this.fetchDataViaRest(\r\n \"PUT\",\r\n `datapoint/${sysApUuid}/${deviceSerial}.${channel}.${dataPoint}`,\r\n value\r\n );\r\n\r\n // Process response\r\n return await this.processRestResponse(response, isSetDataPointResponse);\r\n }\r\n\r\n private async fetchDataViaRest(\r\n method: HttpRequestMethod,\r\n route: string,\r\n body: BodyInit | null | undefined = undefined\r\n ): Promise<Response> {\r\n // Set up request info\r\n const info: RequestInfo = `${this.tlsEnabled ? \"https\" : \"http\"}://${\r\n this.hostName\r\n }/fhapi/v1/api/rest/${route}`;\r\n\r\n // Set up request init\r\n const init: RequestInit = {\r\n method: method,\r\n headers: {\r\n Authorization: `Basic ${this.basicAuthKey}`,\r\n },\r\n body: body,\r\n };\r\n\r\n // Get response from system access point\r\n return await fetch(info, init);\r\n }\r\n\r\n private async processRestResponse<TResponse>(\r\n response: Response,\r\n typeGuard: (obj: unknown, verbose: boolean) => obj is TResponse\r\n ): Promise<TResponse> {\r\n let body: unknown;\r\n let message: string;\r\n\r\n // Process response\r\n switch (response.status) {\r\n case 200:\r\n body = await response.json();\r\n if (!typeGuard(body, this.verboseErrors)) {\r\n message = \"Received message has an unexpected type!\";\r\n console.error(message, body);\r\n throw new Error(message);\r\n }\r\n\r\n return body;\r\n case 401:\r\n message = \"Authentication information is missing or invalid.\";\r\n console.error(message);\r\n throw new Error(message);\r\n case 502:\r\n message = await response.text();\r\n console.error(message);\r\n throw new Error(message);\r\n default:\r\n message = `Received HTTP ${\r\n response.status\r\n } status code unexpectedly: ${await response.text()}`;\r\n console.error(message);\r\n throw new Error(message);\r\n }\r\n }\r\n\r\n private processWebSocketMessage(data: RawData, isBinary: boolean): void {\r\n // Do not process binary messages\r\n if (isBinary) {\r\n console.warn(\r\n \"Binary message received. Binary messages are not processed.\"\r\n );\r\n return;\r\n }\r\n\r\n console.debug(\"Message received\");\r\n /*\r\n * Deserialize the message.\r\n * The message is expected to be deserializable as a web socket message.\r\n * If that is not the case, that's an error case.\r\n */\r\n const serialized = data.toString();\r\n const message: unknown = JSON.parse(serialized);\r\n\r\n if (isWebSocketMessage(message, this.verboseErrors)) {\r\n this.webSocketMessageSubject.next(message);\r\n return;\r\n }\r\n\r\n console.error(\"Received message has an unexpected type!\", serialized);\r\n }\r\n}\r\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE_ts_interface_checker_865cda28__","array","createCheckers","iface","indexKey","opt","x","d","ChannelTypeSuite","Channel","displayName","functionID","room","floor","inputs","outputs","type","ConfigurationTypeSuite","Configuration","DeviceTypeSuite","Device","interface","nativeId","channels","DeviceListTypeSuite","DeviceList","DeviceResponseTypeSuite","DeviceResponse","devices","DevicesTypeSuite","Devices","ErrorTypeSuite","Error","code","detail","title","FloorsTypeSuite","Floors","name","rooms","GetDataPointResponseTypeSuite","GetDataPointResponse","values","InOutPutTypeSuite","InOutPut","value","pairingID","RoomsTypeSuite","Rooms","ScenesTriggeredTypeSuite","ScenesTriggered","SetDataPointResponseTypeSuite","SetDataPointResponse","SysApTypeSuite","SysAP","floorplan","floors","sysapName","users","error","UsersTypeSuite","Users","enabled","flags","grantedPermissions","jid","requestedPermissions","role","VirtualDeviceResponseTypeSuite","VirtualDeviceResponse","serial","WebSocketMessageTypeSuite","WebSocketMessage","datapoints","devicesAdded","devicesRemoved","scenesTriggered","VirtualDeviceType","check","checker","verbose","console","test","isWebSocketMessage","isConfiguration","isDeviceList","isDeviceResponse","isGetDataPointResponse","isSetDataPointResponse","isVirtualDeviceResponse","extendStatics","b","setPrototypeOf","__proto__","Array","p","__extends","TypeError","String","__","this","constructor","create","__values","s","Symbol","iterator","m","i","length","next","done","__read","n","r","e","ar","push","__spreadArray","to","from","pack","arguments","l","slice","concat","isFunction","createErrorClass","createImpl","ctorFunc","instance","stack","UnsubscriptionError","_super","errors","message","map","err","toString","join","arrRemove","arr","item","index","indexOf","splice","Subscription","initialTeardown","closed","_parentage","_finalizers","empty","unsubscribe","e_1","_a","e_2","_b","isArray","_parentage_1","_parentage_1_1","remove","e_1_1","return","initialFinalizer","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","add","teardown","_hasParent","_addParent","parent","includes","_removeParent","EMPTY","EMPTY_SUBSCRIPTION","isSubscription","config","undefined","timeoutProvider","setTimeout","handler","timeout","args","_i","delegate","apply","clearTimeout","handle","noop","COMPLETE_NOTIFICATION","createNotification","kind","context","errorContext","cb","isRoot","errorThrown","Subscriber","destination","_this","isStopped","EMPTY_OBSERVER","complete","SafeSubscriber","handleStoppedNotification","nextNotification","_next","_error","_complete","_bind","Function","bind","fn","thisArg","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","reportUnhandledError","notification","subscriber","onStoppedNotification","observable","identity","pipeFromArray","fns","input","reduce","prev","Observable","subscribe","_subscribe","lift","operator","source","isObserver","_trySubscribe","sink","forEach","promiseCtor","getPromiseCtor","resolve","reject","pipe","operations","toPromise","Promise","ObjectUnsubscribedError","Subject","currentObservers","observers","hasError","thrownError","subject","AnonymousSubject","_throwIfClosed","_c","shift","configurable","_checkFinalizedStatuses","_innerSubscribe","asObservable","__WEBPACK_EXTERNAL_MODULE_ws__","WebSocket","SystemAccessPoint","hostName","userName","password","tlsEnabled","verboseErrors","webSocketMessageSubject","basicAuthKey","Buffer","connectWebSocket","certificateVerification","webSocket","readyState","createWebSocket","createVirtualDevice","sysApUuid","deviceSerial","virtualDevice","response","fetchDataViaRest","JSON","stringify","processRestResponse","warn","url","options","rejectUnauthorized","headers","Authorization","on","data","debug","log","isBinary","processWebSocketMessage","disconnectWebSocket","force","terminate","close","getConfiguration","getDeviceList","getDevice","getDatapoint","channel","dataPoint","getWebSocketMessages","setDatapoint","method","route","body","info","init","fetch","typeGuard","status","json","text","serialized","parse"],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InOutPut } from "./in-out-put";
|
|
2
|
+
/**
|
|
3
|
+
* Describes a device channel
|
|
4
|
+
*
|
|
5
|
+
* @interface
|
|
6
|
+
*/
|
|
7
|
+
export interface Channel {
|
|
8
|
+
displayName?: string;
|
|
9
|
+
functionID?: string;
|
|
10
|
+
room?: string;
|
|
11
|
+
floor?: string;
|
|
12
|
+
inputs?: {
|
|
13
|
+
[key: string]: InOutPut;
|
|
14
|
+
};
|
|
15
|
+
outputs?: {
|
|
16
|
+
[key: string]: InOutPut;
|
|
17
|
+
};
|
|
18
|
+
type?: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/model/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;KACzB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;KACzB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/model/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-list.d.ts","sourceRoot":"","sources":["../../../src/model/device-list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-response.d.ts","sourceRoot":"","sources":["../../../src/model/device-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Channel } from "./channel";
|
|
2
|
+
/**
|
|
3
|
+
* Describes a device
|
|
4
|
+
*
|
|
5
|
+
* @interface
|
|
6
|
+
*/
|
|
7
|
+
export interface Device {
|
|
8
|
+
displayName?: string;
|
|
9
|
+
room?: string;
|
|
10
|
+
floor?: string;
|
|
11
|
+
interface?: string;
|
|
12
|
+
nativeId?: string;
|
|
13
|
+
channels?: {
|
|
14
|
+
[key: string]: Channel;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/model/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../src/model/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/model/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floors.d.ts","sourceRoot":"","sources":["../../../src/model/floors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,KAAK,CAAC;KACd,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-data-point-response.d.ts","sourceRoot":"","sources":["../../../src/model/get-data-point-response.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-out-put.d.ts","sourceRoot":"","sources":["../../../src/model/in-out-put.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { Channel } from "./channel";
|
|
2
|
+
export { Configuration } from "./configuration";
|
|
3
|
+
export { Device } from "./device";
|
|
4
|
+
export { DeviceList } from "./device-list";
|
|
5
|
+
export { DeviceResponse } from "./device-response";
|
|
6
|
+
export { Devices } from "./devices";
|
|
7
|
+
export { Error } from "./error";
|
|
8
|
+
export { Floors } from "./floors";
|
|
9
|
+
export { GetDataPointResponse } from "./get-data-point-response";
|
|
10
|
+
export { InOutPut } from "./in-out-put";
|
|
11
|
+
export { Rooms } from "./rooms";
|
|
12
|
+
export { ScenesTriggered } from "./scenes-triggered";
|
|
13
|
+
export { SetDataPointResponse } from "./set-data-point-response";
|
|
14
|
+
export { SysAP } from "./sys-ap";
|
|
15
|
+
export { Users } from "./users";
|
|
16
|
+
export { isConfiguration, isDeviceList, isDeviceResponse, isGetDataPointResponse, isSetDataPointResponse, isWebSocketMessage, } from "./validator";
|
|
17
|
+
export { VirtualDevice, VirtualDeviceType } from "./virtual-device";
|
|
18
|
+
export { VirtualDeviceResponse } from "./virtual-device-response";
|
|
19
|
+
export { WebSocketMessage } from "./websocket-message";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAA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