{"ast":null,"code":"function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport axios from \"axios\";\nexport default class api {\n  constructor(host) {\n    _defineProperty(this, \"host\", \"http://localhost:4723\");\n\n    this.host = host ? host : this.host;\n    this.host = \"http://honeyfarm.zigbang.io\";\n  }\n\n  async getDevices() {\n    try {\n      const result = await axios.get(`${this.host}/devices`, {\n        headers: {\n          'Accept': '*/*',\n          'Content-Type': 'application/json'\n        },\n        params: {\n          all: true\n        }\n      });\n      return result;\n    } catch (e) {\n      console.error(e);\n      return undefined;\n    }\n  }\n\n}","map":{"version":3,"sources":["/Users/showstop/work/zigbang/honeyfarm/packages/dashboard/src/api.ts"],"names":["axios","api","constructor","host","getDevices","result","get","headers","params","all","e","console","error","undefined"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,eAAe,MAAMC,GAAN,CAAU;AAGrBC,EAAAA,WAAW,CAACC,IAAD,EAAgB;AAAA,kCAFZ,uBAEY;;AACvB,SAAKA,IAAL,GAAYA,IAAI,GAAGA,IAAH,GAAU,KAAKA,IAA/B;AACN,SAAKA,IAAL,GAAY,6BAAZ;AACG;;AAED,QAAMC,UAAN,GAAmB;AACf,QAAI;AACA,YAAMC,MAAM,GAAG,MAAML,KAAK,CAACM,GAAN,CAAW,GAAE,KAAKH,IAAK,UAAvB,EACrB;AACII,QAAAA,OAAO,EAAE;AACL,oBAAU,KADL;AAEL,0BAAgB;AAFX,SADb;AAKIC,QAAAA,MAAM,EAAE;AAAEC,UAAAA,GAAG,EAAE;AAAP;AALZ,OADqB,CAArB;AASA,aAAOJ,MAAP;AACH,KAXD,CAWE,OAAOK,CAAP,EAAU;AACRC,MAAAA,OAAO,CAACC,KAAR,CAAcF,CAAd;AACA,aAAOG,SAAP;AACH;AACJ;;AAxBoB","sourcesContent":["import axios from \"axios\"\nexport default class api {\n    private host = \"http://localhost:4723\"\n\n    constructor(host?: string) {\n        this.host = host ? host : this.host\n\t\tthis.host = \"http://honeyfarm.zigbang.io\"\n    }\n\n    async getDevices() {\n        try {\n            const result = await axios.get(`${this.host}/devices`, \n            {\n                headers: {\n                    'Accept': '*/*',\n                    'Content-Type': 'application/json'\n                },\n                params: { all: true}\n            })\n    \n            return result\n        } catch (e) {\n            console.error(e)\n            return undefined\n        }\n    }\n\n}"]},"metadata":{},"sourceType":"module"}