{"ast":null,"code":"import _regeneratorRuntime from\"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/regenerator\";import _asyncToGenerator from\"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";import _classCallCheck from\"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck\";import axios from\"axios\";var TagGroupServicesClass=function TagGroupServicesClass(){_classCallCheck(this,TagGroupServicesClass);this.getAll=/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:return _context2.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve,reject){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return axios.get(process.env.REACT_APP_BASE_URL+\"/tag-groups\").then(function(res){resolve(res.data);});case 2:case\"end\":return _context.stop();}}},_callee);}));return function(_x,_x2){return _ref2.apply(this,arguments);};}()));case 1:case\"end\":return _context2.stop();}}},_callee2);}));this.store=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(params){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:return _context4.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(resolve,reject){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.next=2;return axios.post(process.env.REACT_APP_BASE_URL+\"/tag-groups\",params).then(function(res){resolve(res.data);});case 2:case\"end\":return _context3.stop();}}},_callee3);}));return function(_x4,_x5){return _ref4.apply(this,arguments);};}()));case 1:case\"end\":return _context4.stop();}}},_callee4);}));return function(_x3){return _ref3.apply(this,arguments);};}();this.findOne=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id){return _regeneratorRuntime.wrap(function _callee6$(_context6){while(1){switch(_context6.prev=_context6.next){case 0:return _context6.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(resolve,reject){return _regeneratorRuntime.wrap(function _callee5$(_context5){while(1){switch(_context5.prev=_context5.next){case 0:_context5.next=2;return axios.put(process.env.REACT_APP_BASE_URL+\"/tag-groups/\"+id).then(function(res){resolve(res.data);});case 2:case\"end\":return _context5.stop();}}},_callee5);}));return function(_x7,_x8){return _ref6.apply(this,arguments);};}()));case 1:case\"end\":return _context6.stop();}}},_callee6);}));return function(_x6){return _ref5.apply(this,arguments);};}();this.update=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id,params){return _regeneratorRuntime.wrap(function _callee8$(_context8){while(1){switch(_context8.prev=_context8.next){case 0:return _context8.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(resolve,reject){return _regeneratorRuntime.wrap(function _callee7$(_context7){while(1){switch(_context7.prev=_context7.next){case 0:_context7.next=2;return axios.patch(process.env.REACT_APP_BASE_URL+\"/tag-groups/\"+id,params).then(function(res){resolve(res.data);});case 2:case\"end\":return _context7.stop();}}},_callee7);}));return function(_x11,_x12){return _ref8.apply(this,arguments);};}()));case 1:case\"end\":return _context8.stop();}}},_callee8);}));return function(_x9,_x10){return _ref7.apply(this,arguments);};}();this.delete=/*#__PURE__*/function(){var _ref9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id){return _regeneratorRuntime.wrap(function _callee10$(_context10){while(1){switch(_context10.prev=_context10.next){case 0:return _context10.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(resolve,reject){return _regeneratorRuntime.wrap(function _callee9$(_context9){while(1){switch(_context9.prev=_context9.next){case 0:_context9.next=2;return axios.delete(process.env.REACT_APP_BASE_URL+\"/tag-groups/\"+id).then(function(res){resolve(res.data);});case 2:case\"end\":return _context9.stop();}}},_callee9);}));return function(_x14,_x15){return _ref10.apply(this,arguments);};}()));case 1:case\"end\":return _context10.stop();}}},_callee10);}));return function(_x13){return _ref9.apply(this,arguments);};}();this.getServers=/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(){return _regeneratorRuntime.wrap(function _callee12$(_context12){while(1){switch(_context12.prev=_context12.next){case 0:return _context12.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(resolve,reject){return _regeneratorRuntime.wrap(function _callee11$(_context11){while(1){switch(_context11.prev=_context11.next){case 0:_context11.next=2;return axios.get(process.env.REACT_APP_BASE_URL+\"/gateway-servers\").then(function(res){resolve(res.data);});case 2:case\"end\":return _context11.stop();}}},_callee11);}));return function(_x16,_x17){return _ref12.apply(this,arguments);};}()));case 1:case\"end\":return _context12.stop();}}},_callee12);}));this.getValues=/*#__PURE__*/function(){var _ref13=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(id,data){return _regeneratorRuntime.wrap(function _callee14$(_context14){while(1){switch(_context14.prev=_context14.next){case 0:return _context14.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(resolve,reject){return _regeneratorRuntime.wrap(function _callee13$(_context13){while(1){switch(_context13.prev=_context13.next){case 0:_context13.next=2;return axios.post(process.env.REACT_APP_BASE_URL+\"/websocket/getValues/\"+id,data).then(function(res){resolve(res.data);});case 2:case\"end\":return _context13.stop();}}},_callee13);}));return function(_x20,_x21){return _ref14.apply(this,arguments);};}()));case 1:case\"end\":return _context14.stop();}}},_callee14);}));return function(_x18,_x19){return _ref13.apply(this,arguments);};}();};export default TagGroupServicesClass;","map":{"version":3,"sources":["C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/src/components/pages/TagGroups/TagGroupServicesClass.ts"],"names":["axios","TagGroupServicesClass","getAll","Promise","resolve","reject","get","process","env","REACT_APP_BASE_URL","then","res","data","store","params","post","findOne","id","put","update","patch","delete","getServers","getValues"],"mappings":"ofAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,C,GAEMC,CAAAA,qB,mFACGC,M,sEAAS,yKACP,GAAIC,CAAAA,OAAJ,2FAAY,iBAAOC,OAAP,CAAgBC,MAAhB,wIACXL,CAAAA,KAAK,CAACM,GAAN,CAAUC,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,aAA3C,EAA0DC,IAA1D,CAA+D,SAACC,GAAD,CAAS,CAC5EP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAFK,CADW,uDAAZ,oEADO,0D,QAQTC,K,2FAAQ,kBAAOC,MAAP,uJACN,GAAIX,CAAAA,OAAJ,2FAAY,kBAAOC,OAAP,CAAgBC,MAAhB,6IACXL,CAAAA,KAAK,CACRe,IADG,CACER,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,aADnC,CACkDK,MADlD,EAEHJ,IAFG,CAEE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAJG,CADW,yDAAZ,qEADM,0D,sEAURI,O,2FAAU,kBAAOC,EAAP,uJACR,GAAId,CAAAA,OAAJ,2FAAY,kBAAOC,OAAP,CAAgBC,MAAhB,6IACXL,CAAAA,KAAK,CACRkB,GADG,CACCX,OAAO,CAACC,GAAR,CAA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,CAEFR,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,uBAAjC,CAA2DQ,EAFzD,CAGFL,IAHE,EAKHF,IALG,CAKE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAPG,CADW,2DAAZ,wEADU,4D,0EAcrB,cAAeX,CAAAA,qBAAf","sourcesContent":["import axios from \"axios\";\r\n\r\nclass TagGroupServicesClass {\r\n  public getAll = async () => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios.get(process.env.REACT_APP_BASE_URL + \"/tag-groups\").then((res) => {\r\n        resolve(res.data);\r\n      });\r\n    });\r\n  };\r\n\r\n  public store = async (params: any) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .post(process.env.REACT_APP_BASE_URL + \"/tag-groups\", params)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public findOne = async (id: number) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .put(process.env.REACT_APP_BASE_URL + \"/tag-groups/\" + id)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public update = async (id: number, params: any) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .patch(process.env.REACT_APP_BASE_URL + \"/tag-groups/\" + id, params)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public delete = async (id: number) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .delete(process.env.REACT_APP_BASE_URL + \"/tag-groups/\" + id)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n  public getServers = async () => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .get(process.env.REACT_APP_BASE_URL + \"/gateway-servers\")\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public getValues = async (id:number,data:any) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .post(\r\n          process.env.REACT_APP_BASE_URL + \"/websocket/getValues/\" + id,\r\n          data\r\n        )\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n}\r\n\r\nexport default TagGroupServicesClass;\r\n"]},"metadata":{},"sourceType":"module"}